| ID | Title | Duration (ms) |
|---|---|---|
| 1 | Redirect Actions it handles saveReturnUrl | 4 |
| 2 | Redirect Actions it handles saveReturnUrl when there is a query string | 4 |
| 3 | Redirect Actions it handles clearReturnUrl | 1 |
| 4 | Modal it renders normally | 14 |
| 5 | Modal it handles unmounting | 5 |
| 6 | Modal it updates props to show (for key listener and body class) | 10 |
| 7 | Modal it updates props to hide (for key listener and body class) | 4 |
| 8 | Modal it handles window resizing | 4 |
| 9 | Modal it closes when the backdrop is clicked through modal, but not when clicking on the dialog | 3 |
| 10 | Modal it closes when the esc key is pressed, but not another key | 2 |
| 11 | Modal it renders with a header | 5 |
| 12 | Modal it renders with a footer | 4 |
| 13 | Paging it renders normally | 9 |
| 14 | Paging it handles previous page click | 5 |
| 15 | Paging it handles next page click | 6 |
| 16 | Button it renders normally | 2 |
| 17 | Button it renders disabled | 1 |
| 18 | Button it calls the click handler | 1 |
| 19 | ControlGroup it renders normally | 2 |
| 20 | ControlGroup it renders without label or help elements | 2 |
| 21 | Spinner it renders normally | 2 |
| 22 | Spinner it renders visible | 2 |
| 23 | Spinner it renders with space on the left | 2 |
| 24 | Spinner it renders with space on the right | 2 |
| 25 | TextControl it renders normally | 6 |
| 26 | TextControl it renders disabled | 4 |
| 27 | TextareaControl it renders normally | 3 |
| 28 | TextareaControl it renders disabled | 2 |
| 29 | Payload Sources Constants it loads | 0 |
| 30 | Redirect Constants it loads | 1 |
| 31 | JSON Fetch Helper it makes a basic GET request | 1 |
| 32 | JSON Fetch Helper it sends a csrf token header if crumb cookie is preset | 0 |
| 33 | JSON Fetch Helper it redirects to login if the x-auth-required header is present | 1 |
| 34 | JSON Fetch Helper it makes a GET request with query data | 1 |
| 35 | JSON Fetch Helper it makes a basic POST request | 0 |
| 36 | JSON Fetch Helper it makes a request and gets a less than 2xx response | 1 |
| 37 | JSON Fetch Helper it makes a request and gets a greater than 2xx response | 0 |
| 38 | JSON Fetch Helper it handles an xhr error | 1 |
| 39 | Parse Validation Helper it handles no validation errors | 1 |
| 40 | Parse Validation Helper it handles validation errors with keys | 1 |
| 41 | Parse Validation Helper it handles validation errors with keys (matching the because pattern) | 2 |
| 42 | Parse Validation Helper it handles validation errors without keys | 1 |
| 43 | Account Actions it handles getAccountSettings successfully | 2 |
| 44 | Account Actions it handles getAccountSettings when xhr fails | 1 |
| 45 | Account Actions it handles saveAccountSettings successfully | 2 |
| 46 | Account Actions it handles saveAccountSettings when xhr fails | 2 |
| 47 | Account Actions it handles getUserSettings successfully | 1 |
| 48 | Account Actions it handles getUserSettings when xhr fails | 1 |
| 49 | Account Actions it handles saveUserSettings successfully | 2 |
| 50 | Account Actions it handles saveUserSettings when xhr fails | 9 |
| 51 | Account Actions it handles savePasswordSettings successfully | 2 |
| 52 | Account Actions it handles savePasswordSettings when xhr fails | 1 |
| 53 | Account Actions it handles savePasswordSettings when passwords do not match | 1 |
| 54 | Account Constants it loads | 1 |
| 55 | Account Routes it loads | 0 |
| 56 | Account App Component it renders normally | 19 |
| 57 | Account Footer it renders normally | 2 |
| 58 | Account NavBar it renders normally | 8 |
| 59 | Account NavBar it toggles the menu | 11 |
| 60 | Account NavBar it receives new props | 9 |
| 61 | Account Home Component it renders normally | 14 |
| 62 | Account Home Component it refreshes the time with interval handler | 12 |
| 63 | Login Not Found Component it renders normally | 4 |
| 64 | Login Not Found Component it handles unmounting | 3 |
| 65 | Account Settings Account Form it renders normally | 3 |
| 66 | Account Settings Account Form it handles unmounting | 10 |
| 67 | Account Settings Account Form it handles receiving props before and after the store has been hydtrated | 15 |
| 68 | Account Settings Account Form it handles a submit event | 10 |
| 69 | Account Settings Account Form it renders with loading state | 15 |
| 70 | Account Settings Account Form it renders with success state | 8 |
| 71 | Account Settings Account Form it renders with error state | 6 |
| 72 | Account Home Component it renders normally | 10 |
| 73 | Account Home Component it handles unmounting | 8 |
| 74 | Account Home Component it handles a store change | 16 |
| 75 | Account Settings Password Form it renders normally | 7 |
| 76 | Account Settings Password Form it handles unmounting | 5 |
| 77 | Account Settings Password Form it handles receiving props with and without the store having success | 16 |
| 78 | Account Settings Password Form it handles a submit event | 7 |
| 79 | Account Settings Password Form it renders with loading state | 7 |
| 80 | Account Settings Password Form it renders with success state | 5 |
| 81 | Account Settings Password Form it renders with error state | 5 |
| 82 | Account Settings User Form it renders normally | 6 |
| 83 | Account Settings User Form it handles unmounting | 5 |
| 84 | Account Settings User Form it handles receiving props before and after the store has been hydtrated | 21 |
| 85 | Account Settings User Form it handles a submit event | 6 |
| 86 | Account Settings User Form it renders with loading state | 6 |
| 87 | Account Settings User Form it renders with success state | 6 |
| 88 | Account Settings User Form it renders with error state | 6 |
| 89 | Account App it renders normally | 16 |
| 90 | Account Account Store it returns default state | 2 |
| 91 | Account Account Store it handles a GET_ACCOUNT_SETTINGS action | 2 |
| 92 | Account Account Store it handles a GET_ACCOUNT_SETTINGS_RESPONSE action (success) | 1 |
| 93 | Account Account Store it handles a GET_ACCOUNT_SETTINGS_RESPONSE action (validation errors) | 1 |
| 94 | Account Account Store it handles a GET_ACCOUNT_SETTINGS_RESPONSE action (other error) | 1 |
| 95 | Account Account Store it handles a SAVE_ACCOUNT_SETTINGS action | 0 |
| 96 | Account Account Store it handles a SAVE_ACCOUNT_SETTINGS_RESPONSE action (success) | 1 |
| 97 | Account Account Store it sets a timeout to clear the success field after successful save | 0 |
| 98 | Account Password Store it returns default state | 2 |
| 99 | Account Password Store it handles a SAVE_PASSWORD_SETTINGS action | 9 |
| 100 | Account Password Store it handles a SAVE_PASSWORD_SETTINGS_RESPONSE action (success) | 6 |
| 101 | Account Password Store it handles a SAVE_PASSWORD_SETTINGS_RESPONSE action (validation errors) | 7 |
| 102 | Account Password Store it handles a SAVE_PASSWORD_SETTINGS_RESPONSE action (other error) | 8 |
| 103 | Account Password Store it sets a timeout to clear the success field after successful save | 14 |
| 104 | Account User Store it returns default state | 2 |
| 105 | Account User Store it handles a GET_USER_SETTINGS action | 7 |
| 106 | Account User Store it handles a GET_USER_SETTINGS_RESPONSE action (success) | 23 |
| 107 | Account User Store it handles a GET_USER_SETTINGS_RESPONSE action (validation errors) | 10 |
| 108 | Account User Store it handles a GET_USER_SETTINGS_RESPONSE action (other error) | 10 |
| 109 | Account User Store it handles a SAVE_USER_SETTINGS action | 10 |
| 110 | Account User Store it handles a SAVE_USER_SETTINGS_RESPONSE action (success) | 13 |
| 111 | Account User Store it sets a timeout to clear the success field after successful save | 21 |
| 112 | Admin Routes it loads | 0 |
| 113 | Admin Account Actions it handles getResults successfully | 2 |
| 114 | Admin Account Actions it handles getResults when xhr fails | 1 |
| 115 | Admin Account Actions it handles getDetails successfully | 1 |
| 116 | Admin Account Actions it handles getDetails when xhr fails | 2 |
| 117 | Admin Account Actions it handles showCreateNew | 0 |
| 118 | Admin Account Actions it handles hideCreateNew | 1 |
| 119 | Admin Account Actions it handles createNew successfully (without caller) | 1 |
| 120 | Admin Account Actions it handles createNew successfully (with caller) | 1 |
| 121 | Admin Account Actions it handles createNew when xhr fails | 2 |
| 122 | Admin Account Actions it handles saveDetails successfully | 1 |
| 123 | Admin Account Actions it handles saveDetails when xhr fails | 1 |
| 124 | Admin Account Actions it handles linkUser successfully | 2 |
| 125 | Admin Account Actions it handles linkUser when xhr fails | 1 |
| 126 | Admin Account Actions it handles unlinkUser successfully | 2 |
| 127 | Admin Account Actions it handles unlinkUser when xhr fails | 1 |
| 128 | Admin Account Actions it handles newStatus successfully | 1 |
| 129 | Admin Account Actions it handles newStatus when xhr fails | 2 |
| 130 | Admin Account Actions it handles newNote successfully | 1 |
| 131 | Admin Account Actions it handles newNote when xhr fails | 1 |
| 132 | Admin Account Actions it handles delete successfully (without caller) | 2 |
| 133 | Admin Account Actions it handles delete successfully (with caller) | 2 |
| 134 | Admin Account Actions it handles delete when xhr fails | 1 |
| 135 | Admin Admin Group Actions it handles getResults successfully | 2 |
| 136 | Admin Admin Group Actions it handles getResults when xhr fails | 1 |
| 137 | Admin Admin Group Actions it handles getDetails successfully | 2 |
| 138 | Admin Admin Group Actions it handles getDetails when xhr fails | 1 |
| 139 | Admin Admin Group Actions it handles showCreateNew | 0 |
| 140 | Admin Admin Group Actions it handles hideCreateNew | 1 |
| 141 | Admin Admin Group Actions it handles createNew successfully (without caller) | 1 |
| 142 | Admin Admin Group Actions it handles createNew successfully (with caller) | 8 |
| 143 | Admin Admin Group Actions it handles createNew when xhr fails | 1 |
| 144 | Admin Admin Group Actions it handles saveDetails successfully | 1 |
| 145 | Admin Admin Group Actions it handles saveDetails when xhr fails | 2 |
| 146 | Admin Admin Group Actions it handles savePermissions successfully | 1 |
| 147 | Admin Admin Group Actions it handles savePermissions when xhr fails | 1 |
| 148 | Admin Admin Group Actions it handles delete successfully (without caller) | 1 |
| 149 | Admin Admin Group Actions it handles delete successfully (with caller) | 1 |
| 150 | Admin Admin Group Actions it handles delete when xhr fails | 2 |
| 151 | Admin Admin Actions it handles getResults successfully | 1 |
| 152 | Admin Admin Actions it handles getResults when xhr fails | 1 |
| 153 | Admin Admin Actions it handles getDetails successfully | 2 |
| 154 | Admin Admin Actions it handles getDetails when xhr fails | 1 |
| 155 | Admin Admin Actions it handles showCreateNew | 1 |
| 156 | Admin Admin Actions it handles hideCreateNew | 0 |
| 157 | Admin Admin Actions it handles createNew successfully (without caller) | 1 |
| 158 | Admin Admin Actions it handles createNew successfully (with caller) | 2 |
| 159 | Admin Admin Actions it handles createNew when xhr fails | 1 |
| 160 | Admin Admin Actions it handles saveDetails successfully | 1 |
| 161 | Admin Admin Actions it handles saveDetails when xhr fails | 2 |
| 162 | Admin Admin Actions it handles linkUser successfully | 1 |
| 163 | Admin Admin Actions it handles linkUser when xhr fails | 2 |
| 164 | Admin Admin Actions it handles unlinkUser successfully | 1 |
| 165 | Admin Admin Actions it handles unlinkUser when xhr fails | 1 |
| 166 | Admin Admin Actions it handles saveGroups successfully | 2 |
| 167 | Admin Admin Actions it handles saveGroups when xhr fails | 1 |
| 168 | Admin Admin Actions it handles savePermissions successfully | 2 |
| 169 | Admin Admin Actions it handles savePermissions when xhr fails | 1 |
| 170 | Admin Admin Actions it handles delete successfully (without caller) | 2 |
| 171 | Admin Admin Actions it handles delete successfully (with caller) | 1 |
| 172 | Admin Admin Actions it handles delete when xhr fails | 1 |
| 173 | Admin Status Actions it handles getResults successfully | 2 |
| 174 | Admin Status Actions it handles getResults when xhr fails | 1 |
| 175 | Admin Status Actions it handles getDetails successfully | 1 |
| 176 | Admin Status Actions it handles getDetails when xhr fails | 2 |
| 177 | Admin Status Actions it handles showCreateNew | 0 |
| 178 | Admin Status Actions it handles hideCreateNew | 0 |
| 179 | Admin Status Actions it handles createNew successfully (without caller) | 2 |
| 180 | Admin Status Actions it handles createNew successfully (with caller) | 3 |
| 181 | Admin Status Actions it handles createNew when xhr fails | 1 |
| 182 | Admin Status Actions it handles saveDetails successfully | 1 |
| 183 | Admin Status Actions it handles saveDetails when xhr fails | 2 |
| 184 | Admin Status Actions it handles delete successfully (without caller) | 1 |
| 185 | Admin Status Actions it handles delete successfully (with caller) | 1 |
| 186 | Admin Status Actions it handles delete when xhr fails | 2 |
| 187 | Admin User Actions it handles getResults successfully | 2 |
| 188 | Admin User Actions it handles getResults when xhr fails | 1 |
| 189 | Admin User Actions it handles getIdentity successfully | 1 |
| 190 | Admin User Actions it handles getIdentity when xhr fails | 2 |
| 191 | Admin User Actions it handles showCreateNew | 0 |
| 192 | Admin User Actions it handles hideCreateNew | 0 |
| 193 | Admin User Actions it handles createNew successfully (without caller) | 2 |
| 194 | Admin User Actions it handles createNew successfully (with caller) | 1 |
| 195 | Admin User Actions it handles createNew when xhr fails | 2 |
| 196 | Admin User Actions it handles saveIdentity successfully | 5 |
| 197 | Admin User Actions it handles saveIdentity when xhr fails | 1 |
| 198 | Admin User Actions it handles savePassword successfully | 2 |
| 199 | Admin User Actions it handles savePassword when password match fails | 1 |
| 200 | Admin User Actions it handles savePassword when xhr fails | 1 |
| 201 | Admin User Actions it handles delete successfully (without caller) | 1 |
| 202 | Admin User Actions it handles delete successfully (with caller) | 2 |
| 203 | Admin User Actions it handles delete when xhr fails | 1 |
| 204 | Admin App Component it renders normally | 11 |
| 205 | Admin Footer it renders normally | 1 |
| 206 | Admin NavBar it renders normally | 8 |
| 207 | Admin NavBar it toggles the menu | 12 |
| 208 | Admin NavBar it receives new props | 10 |
| 209 | Admin Account Create New Form it renders normally | 8 |
| 210 | Admin Account Create New Form it handles unmounting | 7 |
| 211 | Admin Account Create New Form it replaces state when receiving new props where show is false | 8 |
| 212 | Admin Account Create New Form it focuses when receiving new props where show is true | 10 |
| 213 | Admin Account Create New Form it handles a submit event | 9 |
| 214 | Admin Account Create New Form it renders with success state | 10 |
| 215 | Admin Account Create New Form it renders with error state | 9 |
| 216 | Admin Account Delete Form it renders normally | 5 |
| 217 | Admin Account Delete Form it handles unmounting | 11 |
| 218 | Admin Account Delete Form it prevents event propagation when confirm returns false | 4 |
| 219 | Admin Account Delete Form it allows event propagation when confirm returns true | 4 |
| 220 | Admin Account Delete Form it handles a submit event | 4 |
| 221 | Admin Account Delete Form it renders with error state | 5 |
| 222 | Admin Account Details it renders normally | 11 |
| 223 | Admin Account Details it handles unmounting | 7 |
| 224 | Admin Account Details it handles a store change | 13 |
| 225 | Admin Account Details it handles a fetch error | 10 |
| 226 | Admin Account Details Form it renders normally | 1 |
| 227 | Admin Account Details Form it handles unmounting | 1 |
| 228 | Admin Account Details Form it updates state when receiving new props when hydrated is false | 11 |
| 229 | Admin Account Details Form it handles a submit event | 2 |
| 230 | Admin Account Details Form it renders with success state | 9 |
| 231 | Admin Account Details Form it renders with error state | 8 |
| 232 | Admin Account Filter Form it renders normally | 15 |
| 233 | Admin Account Filter Form it handles unmounting | 17 |
| 234 | Admin Account Filter Form it receives new props | 11 |
| 235 | Admin Account Filter Form it handles a menu change | 13 |
| 236 | Admin Account Filter Form it handles submit on enter key, but not another key | 11 |
| 237 | Admin Account Filter Form it handles a page change | 11 |
| 238 | Admin Account Note Form it renders normally | 1 |
| 239 | Admin Account Note Form it handles unmounting | 1 |
| 240 | Admin Account Note Form it renders when notes is undefined | 5 |
| 241 | Admin Account Note Form it renders when notes has items | 11 |
| 242 | Admin Account Note Form it updates state when receiving new props when hydrated is false | 5 |
| 243 | Admin Account Note Form it handles a submit event | 4 |
| 244 | Admin Account Note Form it renders with success state | 5 |
| 245 | Admin Account Note Form it renders with error state | 4 |
| 246 | Admin Account Results it renders normally | 4 |
| 247 | Admin Account Results it handles unmounting | 3 |
| 248 | Admin Account Results it renders with data | 5 |
| 249 | Admin Account Search it renders normally | 17 |
| 250 | Admin Account Search it handles unmounting | 25 |
| 251 | Admin Account Search it receives new props | 23 |
| 252 | Admin Account Search it handles a store change | 34 |
| 253 | Admin Account Search it handles a filter change (from a submit event) | 16 |
| 254 | Admin Account Search it handles a filter change (from an input event) | 28 |
| 255 | Admin Account Search it handles a page change | 30 |
| 256 | Admin Account Search it handles a create new click | 17 |
| 257 | Admin Account Status Form it renders normally | 1 |
| 258 | Admin Account Status Form it handles unmounting | 1 |
| 259 | Admin Account Status Form it renders when status log is undefined | 6 |
| 260 | Admin Account Status Form it renders when status log has items | 6 |
| 261 | Admin Account Status Form it updates state when receiving new props when hydrated is false | 7 |
| 262 | Admin Account Status Form it handles a submit event | 6 |
| 263 | Admin Account Status Form it handles a submit event (when the status is the same) | 6 |
| 264 | Admin Account Status Form it renders with success state | 6 |
| 265 | Admin Account Status Form it renders with error state | 14 |
| 266 | Admin Account User Form it renders normally | 1 |
| 267 | Admin Account User Form it handles unmounting | 1 |
| 268 | Admin Account User Form it updates state when receiving new props when hydrated is false | 7 |
| 269 | Admin Account User Form it handles a submit event (link) | 1 |
| 270 | Admin Account User Form it handles a submit event (unlink) | 2 |
| 271 | Admin Account User Form it prevents event propagation when confirm returns false | 5 |
| 272 | Admin Account User Form it allows event propagation when confirm returns true | 4 |
| 273 | Admin Account User Form it renders with success state | 5 |
| 274 | Admin Account User Form it renders with error state | 5 |
| 275 | Admin Admin Group Create New Form it renders normally | 6 |
| 276 | Admin Admin Group Create New Form it handles unmounting | 6 |
| 277 | Admin Admin Group Create New Form it replaces state when receiving new props where show is false | 8 |
| 278 | Admin Admin Group Create New Form it focuses when receiving new props where show is true | 10 |
| 279 | Admin Admin Group Create New Form it handles a submit event | 5 |
| 280 | Admin Admin Group Create New Form it renders with success state | 7 |
| 281 | Admin Admin Group Create New Form it renders with error state | 8 |
| 282 | Admin Admin Group Delete Form it renders normally | 4 |
| 283 | Admin Admin Group Delete Form it handles unmounting | 3 |
| 284 | Admin Admin Group Delete Form it prevents event propagation when confirm returns false | 4 |
| 285 | Admin Admin Group Delete Form it allows event propagation when confirm returns true | 14 |
| 286 | Admin Admin Group Delete Form it handles a submit event | 4 |
| 287 | Admin Admin Group Delete Form it renders with error state | 5 |
| 288 | Admin Admin Group Details it renders normally | 9 |
| 289 | Admin Admin Group Details it handles unmounting | 6 |
| 290 | Admin Admin Group Details it handles a store change | 10 |
| 291 | Admin Admin Group Details it handles a fetch error | 8 |
| 292 | Admin Admin Group Details Form it renders normally | 2 |
| 293 | Admin Admin Group Details Form it handles unmounting | 0 |
| 294 | Admin Admin Group Details Form it updates state when receiving new props when hydrated is false | 7 |
| 295 | Admin Admin Group Details Form it handles a submit event | 2 |
| 296 | Admin Admin Group Details Form it renders with success state | 5 |
| 297 | Admin Admin Group Details Form it renders with error state | 5 |
| 298 | Admin Admin Group Filter Form it renders normally | 7 |
| 299 | Admin Admin Group Filter Form it handles unmounting | 6 |
| 300 | Admin Admin Group Filter Form it receives new props | 11 |
| 301 | Admin Admin Group Filter Form it handles a menu change | 9 |
| 302 | Admin Admin Group Filter Form it handles submit on enter key, but not another key | 17 |
| 303 | Admin Admin Group Filter Form it handles a page change | 8 |
| 304 | Admin Admin Group Permissions Form it renders normally | 2 |
| 305 | Admin Admin Group Permissions Form it handles unmounting | 0 |
| 306 | Admin Admin Group Permissions Form it updates state when receiving new props when hydrated is false | 7 |
| 307 | Admin Admin Group Permissions Form it handles creating a new permission (via button click) | 5 |
| 308 | Admin Admin Group Permissions Form it handles creating a new permission (on enter key, but not another) | 10 |
| 309 | Admin Admin Group Permissions Form it handles creating a new permission that already exists | 14 |
| 310 | Admin Admin Group Permissions Form it handles toggling a permission | 42 |
| 311 | Admin Admin Group Permissions Form it handles deleting a permission | 11 |
| 312 | Admin Admin Group Permissions Form it handles a submit event | 1 |
| 313 | Admin Admin Group Permissions Form it renders with success state | 15 |
| 314 | Admin Admin Group Permissions Form it renders with error state | 7 |
| 315 | Admin Admin Group Results it renders normally | 3 |
| 316 | Admin Admin Group Results it handles unmounting | 2 |
| 317 | Admin Admin Group Results it renders with data | 4 |
| 318 | Admin Admin Group Search it renders normally | 15 |
| 319 | Admin Admin Group Search it handles unmounting | 16 |
| 320 | Admin Admin Group Search it receives new props | 20 |
| 321 | Admin Admin Group Search it handles a store change | 42 |
| 322 | Admin Admin Group Search it handles a filter change (from a submit event) | 17 |
| 323 | Admin Admin Group Search it handles a filter change (from an input event) | 19 |
| 324 | Admin Admin Group Search it handles a page change | 27 |
| 325 | Admin Admin Group Search it handles a create new click | 15 |
| 326 | Admin Admin Create New Form it renders normally | 6 |
| 327 | Admin Admin Create New Form it handles unmounting | 13 |
| 328 | Admin Admin Create New Form it replaces state when receiving new props where show is false | 8 |
| 329 | Admin Admin Create New Form it focuses when receiving new props where show is true | 8 |
| 330 | Admin Admin Create New Form it handles a submit event | 6 |
| 331 | Admin Admin Create New Form it renders with success state | 7 |
| 332 | Admin Admin Create New Form it renders with error state | 7 |
| 333 | Admin Admin Delete Form it renders normally | 3 |
| 334 | Admin Admin Delete Form it handles unmounting | 2 |
| 335 | Admin Admin Delete Form it prevents event propagation when confirm returns false | 4 |
| 336 | Admin Admin Delete Form it allows event propagation when confirm returns true | 4 |
| 337 | Admin Admin Delete Form it handles a submit event | 4 |
| 338 | Admin Admin Delete Form it renders with error state | 4 |
| 339 | Admin Admin Details it renders normally | 9 |
| 340 | Admin Admin Details it handles unmounting | 7 |
| 341 | Admin Admin Details it handles a store change | 13 |
| 342 | Admin Admin Details it handles a fetch error | 15 |
| 343 | Admin Admin Details Form it renders normally | 2 |
| 344 | Admin Admin Details Form it handles unmounting | 1 |
| 345 | Admin Admin Details Form it updates state when receiving new props when hydrated is false | 8 |
| 346 | Admin Admin Details Form it handles a submit event | 1 |
| 347 | Admin Admin Details Form it renders with success state | 6 |
| 348 | Admin Admin Details Form it renders with error state | 7 |
| 349 | Admin Admin Filter Form it renders normally | 7 |
| 350 | Admin Admin Filter Form it handles unmounting | 6 |
| 351 | Admin Admin Filter Form it receives new props | 8 |
| 352 | Admin Admin Filter Form it handles a menu change | 9 |
| 353 | Admin Admin Filter Form it handles submit on enter key, but not another key | 9 |
| 354 | Admin Admin Filter Form it handles a page change | 8 |
| 355 | Admin Admin Groups Form it renders normally | 2 |
| 356 | Admin Admin Groups Form it handles unmounting | 0 |
| 357 | Admin Admin Groups Form it updates state when receiving new props when hydrated is false | 16 |
| 358 | Admin Admin Groups Form it skips creating a new group when none selected | 12 |
| 359 | Admin Admin Groups Form it handles creating a new group (via button click) | 7 |
| 360 | Admin Admin Groups Form it handles creating a new group that already exists | 15 |
| 361 | Admin Admin Groups Form it handles deleting a group | 28 |
| 362 | Admin Admin Groups Form it handles a submit event | 1 |
| 363 | Admin Admin Groups Form it renders with success state | 8 |
| 364 | Admin Admin Groups Form it renders with error state | 10 |
| 365 | Admin Admin Permissions Form it renders normally | 1 |
| 366 | Admin Admin Permissions Form it handles unmounting | 1 |
| 367 | Admin Admin Permissions Form it updates state when receiving new props when hydrated is false | 7 |
| 368 | Admin Admin Permissions Form it handles creating a new permission (via button click) | 5 |
| 369 | Admin Admin Permissions Form it handles creating a new permission (on enter key, but not another) | 12 |
| 370 | Admin Admin Permissions Form it handles creating a new permission that already exists | 21 |
| 371 | Admin Admin Permissions Form it handles toggling a permission | 42 |
| 372 | Admin Admin Permissions Form it handles deleting a permission | 11 |
| 373 | Admin Admin Permissions Form it handles a submit event | 0 |
| 374 | Admin Admin Permissions Form it renders with success state | 6 |
| 375 | Admin Admin Permissions Form it renders with error state | 6 |
| 376 | Admin Admin Results it renders normally | 2 |
| 377 | Admin Admin Results it handles unmounting | 2 |
| 378 | Admin Admin Results it renders with data | 4 |
| 379 | Admin Admin Search it renders normally | 16 |
| 380 | Admin Admin Search it handles unmounting | 22 |
| 381 | Admin Admin Search it receives new props | 20 |
| 382 | Admin Admin Search it handles a store change | 34 |
| 383 | Admin Admin Search it handles a filter change (from a submit event) | 15 |
| 384 | Admin Admin Search it handles a filter change (from an input event) | 17 |
| 385 | Admin Admin Search it handles a page change | 31 |
| 386 | Admin Admin Search it handles a create new click | 15 |
| 387 | Admin Admin User Form it renders normally | 2 |
| 388 | Admin Admin User Form it handles unmounting | 1 |
| 389 | Admin Admin User Form it updates state when receiving new props when hydrated is false | 7 |
| 390 | Admin Admin User Form it handles a submit event (link) | 1 |
| 391 | Admin Admin User Form it handles a submit event (unlink) | 1 |
| 392 | Admin Admin User Form it prevents event propagation when confirm returns false | 5 |
| 393 | Admin Admin User Form it allows event propagation when confirm returns true | 4 |
| 394 | Admin Admin User Form it renders with success state | 5 |
| 395 | Admin Admin User Form it renders with error state | 5 |
| 396 | Admin Home Component it renders normally | 6 |
| 397 | Admin Home Component it refreshes the time with interval handler | 8 |
| 398 | Login Not Found Component it renders normally | 2 |
| 399 | Login Not Found Component it handles unmounting | 2 |
| 400 | Admin Status Create New Form it renders normally | 16 |
| 401 | Admin Status Create New Form it handles unmounting | 7 |
| 402 | Admin Status Create New Form it replaces state when receiving new props where show is false | 8 |
| 403 | Admin Status Create New Form it focuses when receiving new props where show is true | 8 |
| 404 | Admin Status Create New Form it handles a submit event | 9 |
| 405 | Admin Status Create New Form it renders with success state | 8 |
| 406 | Admin Status Create New Form it renders with error state | 9 |
| 407 | Admin Status Delete Form it renders normally | 4 |
| 408 | Admin Status Delete Form it handles unmounting | 2 |
| 409 | Admin Status Delete Form it prevents event propagation when confirm returns false | 4 |
| 410 | Admin Status Delete Form it allows event propagation when confirm returns true | 4 |
| 411 | Admin Status Delete Form it handles a submit event | 4 |
| 412 | Admin Status Delete Form it renders with error state | 4 |
| 413 | Admin Status Details it renders normally | 6 |
| 414 | Admin Status Details it handles unmounting | 4 |
| 415 | Admin Status Details it handles a store change | 10 |
| 416 | Admin Status Details it handles a fetch error | 16 |
| 417 | Admin Status Details Form it renders normally | 1 |
| 418 | Admin Status Details Form it handles unmounting | 1 |
| 419 | Admin Status Details Form it updates state when receiving new props when hydrated is false | 10 |
| 420 | Admin Status Details Form it handles a submit event | 1 |
| 421 | Admin Status Details Form it renders with success state | 7 |
| 422 | Admin Status Details Form it renders with error state | 7 |
| 423 | Admin Status Filter Form it renders normally | 12 |
| 424 | Admin Status Filter Form it handles unmounting | 10 |
| 425 | Admin Status Filter Form it receives new props | 18 |
| 426 | Admin Status Filter Form it handles a menu change | 15 |
| 427 | Admin Status Filter Form it handles submit on enter key, but not another key | 14 |
| 428 | Admin Status Filter Form it handles a page change | 17 |
| 429 | Admin Status Results it renders normally | 4 |
| 430 | Admin Status Results it handles unmounting | 3 |
| 431 | Admin Status Results it renders with data | 13 |
| 432 | Admin Status Search it renders normally | 22 |
| 433 | Admin Status Search it handles unmounting | 28 |
| 434 | Admin Status Search it receives new props | 37 |
| 435 | Admin Status Search it handles a store change | 59 |
| 436 | Admin Status Search it handles a filter change (from a submit event) | 24 |
| 437 | Admin Status Search it handles a filter change (from an input event) | 28 |
| 438 | Admin Status Search it handles a page change | 38 |
| 439 | Admin Status Search it handles a create new click | 32 |
| 440 | Admin User Create New Form it renders normally | 10 |
| 441 | Admin User Create New Form it handles unmounting | 9 |
| 442 | Admin User Create New Form it replaces state when receiving new props where show is false | 13 |
| 443 | Admin User Create New Form it focuses when receiving new props where show is true | 14 |
| 444 | Admin User Create New Form it handles a submit event | 9 |
| 445 | Admin User Create New Form it renders with success state | 14 |
| 446 | Admin User Create New Form it renders with error state | 13 |
| 447 | Admin User Delete Form it renders normally | 4 |
| 448 | Admin User Delete Form it handles unmounting | 4 |
| 449 | Admin User Delete Form it prevents event propagation when confirm returns false | 6 |
| 450 | Admin User Delete Form it allows event propagation when confirm returns true | 5 |
| 451 | Admin User Delete Form it handles a submit event | 13 |
| 452 | Admin User Delete Form it renders with error state | 5 |
| 453 | Admin User Details it renders normally | 15 |
| 454 | Admin User Details it handles unmounting | 12 |
| 455 | Admin User Details it handles a store change | 20 |
| 456 | Admin User Details it handles a fetch error | 14 |
| 457 | Admin User Filter Form it renders normally | 16 |
| 458 | Admin User Filter Form it handles unmounting | 14 |
| 459 | Admin User Filter Form it receives new props | 23 |
| 460 | Admin User Filter Form it handles a menu change | 31 |
| 461 | Admin User Filter Form it handles submit on enter key, but not another key | 57 |
| 462 | Admin User Filter Form it handles a page change | 20 |
| 463 | Admin User Identity Form it renders normally | 2 |
| 464 | Admin User Identity Form it handles unmounting | 1 |
| 465 | Admin User Identity Form it updates state when receiving new props when hydrated is false | 12 |
| 466 | Admin User Identity Form it handles a submit event | 1 |
| 467 | Admin User Identity Form it renders with success state | 8 |
| 468 | Admin User Identity Form it renders with error state | 8 |
| 469 | Admin User Password Form it renders normally | 6 |
| 470 | Admin User Password Form it handles unmounting | 5 |
| 471 | Admin User Password Form it replaces state when receiving new props when hydrated is false | 6 |
| 472 | Admin User Password Form it handles a submit event | 5 |
| 473 | Admin User Password Form it renders with success state | 6 |
| 474 | Admin User Password Form it renders with error state | 8 |
| 475 | Admin User Results it renders normally | 3 |
| 476 | Admin User Results it handles unmounting | 2 |
| 477 | Admin User Results it renders with data | 5 |
| 478 | Admin User Roles Form it renders normally | 2 |
| 479 | Admin User Roles Form it handles unmounting | 1 |
| 480 | Admin User Roles Form it handles rendering when data is hydrated | 2 |
| 481 | Admin User Roles Form it handles rendering when roles data is provided | 5 |
| 482 | Admin Users Search it renders normally | 29 |
| 483 | Admin Users Search it handles unmounting | 26 |
| 484 | Admin Users Search it receives new props | 29 |
| 485 | Admin Users Search it handles a store change | 54 |
| 486 | Admin Users Search it handles a filter change (from a submit event) | 22 |
| 487 | Admin Users Search it handles a filter change (from an input event) | 26 |
| 488 | Admin Users Search it handles a page change | 41 |
| 489 | Admin Users Search it handles a create new click | 23 |
| 490 | Admin Account Constants it loads | 1 |
| 491 | Admin Admin Constants it loads | 0 |
| 492 | Admin Admin Group Constants it loads | 0 |
| 493 | Admin User Constants it loads | 1 |
| 494 | Admin Status Constants it loads | 0 |
| 495 | Admin App it renders normally | 18 |
| 496 | Admin Account Store it returns default state | 1 |
| 497 | Admin Account Store it returns default results state | 2 |
| 498 | Admin Account Store it returns default create new state | 2 |
| 499 | Admin Account Store it returns default details state | 2 |
| 500 | Admin Account Store it returns default user state | 1 |
| 501 | Admin Account Store it returns default status state | 0 |
| 502 | Admin Account Store it returns default note state | 1 |
| 503 | Admin Account Store it returns default delete state | 0 |
| 504 | Admin Account Store it converts status details (when undefined) | 1 |
| 505 | Admin Account Store it converts status details (when bare object) | 1 |
| 506 | Admin Account Store it converts status details (when populated) | 0 |
| 507 | Admin Account Store it converts notes details (when undefined) | 1 |
| 508 | Admin Account Store it converts notes details (when populated) | 0 |
| 509 | Admin Account Store it handles a GET_RESULTS action | 1 |
| 510 | Admin Account Store it handles a GET_RESULTS_RESPONSE action | 1 |
| 511 | Admin Account Store it handles a SHOW_CREATE_NEW action | 1 |
| 512 | Admin Account Store it handles a HIDE_CREATE_NEW action | 0 |
| 513 | Admin Account Store it handles a CREATE_NEW action | 1 |
| 514 | Admin Account Store it handles a CREATE_NEW_RESPONSE action (success) | 0 |
| 515 | Admin Account Store it handles a CREATE_NEW_RESPONSE action (failure) | 1 |
| 516 | Admin Account Store it handles a GET_DETAILS action | 0 |
| 517 | Admin Account Store it handles a GET_DETAILS_RESPONSE action | 2 |
| 518 | Admin Account Store it handles a SAVE_DETAILS action | 0 |
| 519 | Admin Account Store it handles a SAVE_DETAILS_RESPONSE action (success) | 7 |
| 520 | Admin Account Store it handles a SAVE_DETAILS_RESPONSE action (failure) | 0 |
| 521 | Admin Account Store it handles a LINK_USER action | 1 |
| 522 | Admin Account Store it handles a LINK_USER_RESPONSE action (success) | 0 |
| 523 | Admin Account Store it handles a LINK_USER_RESPONSE action (failure) | 1 |
| 524 | Admin Account Store it handles a UNLINK_USER action | 0 |
| 525 | Admin Account Store it handles a UNLINK_USER_RESPONSE action (success) | 1 |
| 526 | Admin Account Store it handles a UNLINK_USER_RESPONSE action (failure) | 0 |
| 527 | Admin Account Store it handles a NEW_STATUS action | 1 |
| 528 | Admin Account Store it handles a NEW_STATUS_RESPONSE action (success) | 0 |
| 529 | Admin Account Store it handles a NEW_STATUS_RESPONSE action (failure) | 1 |
| 530 | Admin Account Store it handles a NEW_NOTE action | 0 |
| 531 | Admin Account Store it handles a NEW_NOTE_RESPONSE action (success) | 0 |
| 532 | Admin Account Store it handles a NEW_NOTE_RESPONSE action (failure) | 1 |
| 533 | Admin Account Store it handles a DELETE action | 0 |
| 534 | Admin Account Store it handles a DELETE_RESPONSE action (success) | 1 |
| 535 | Admin Account Store it handles a DELETE_RESPONSE action (failure) | 1 |
| 536 | Admin Account Store it handles validation errors (validation keys) | 0 |
| 537 | Admin Account Store it handles validation errors (general) | 0 |
| 538 | Admin Admin Store it returns default state | 2 |
| 539 | Admin Admin Store it returns default results state | 2 |
| 540 | Admin Admin Store it returns default create new state | 2 |
| 541 | Admin Admin Store it returns default details state | 2 |
| 542 | Admin Admin Store it returns default user state | 0 |
| 543 | Admin Admin Store it returns default groups state | 1 |
| 544 | Admin Admin Store it returns default permissions state | 1 |
| 545 | Admin Admin Store it returns default delete state | 0 |
| 546 | Admin Admin Store it returns default delete state | 1 |
| 547 | Admin Admin Store it handles a GET_RESULTS action | 0 |
| 548 | Admin Admin Store it handles a GET_RESULTS_RESPONSE action | 1 |
| 549 | Admin Admin Store it handles a SHOW_CREATE_NEW action | 0 |
| 550 | Admin Admin Store it handles a HIDE_CREATE_NEW action | 0 |
| 551 | Admin Admin Store it handles a CREATE_NEW action | 1 |
| 552 | Admin Admin Store it handles a CREATE_NEW_RESPONSE action (success) | 0 |
| 553 | Admin Admin Store it handles a CREATE_NEW_RESPONSE action (failure) | 0 |
| 554 | Admin Admin Store it handles a GET_DETAILS action | 1 |
| 555 | Admin Admin Store it handles a GET_DETAILS_RESPONSE action | 2 |
| 556 | Admin Admin Store it handles a SAVE_DETAILS action | 0 |
| 557 | Admin Admin Store it handles a SAVE_DETAILS_RESPONSE action (success) | 1 |
| 558 | Admin Admin Store it handles a SAVE_DETAILS_RESPONSE action (failure) | 1 |
| 559 | Admin Admin Store it handles a LINK_USER action | 0 |
| 560 | Admin Admin Store it handles a LINK_USER_RESPONSE action (success) | 1 |
| 561 | Admin Admin Store it handles a LINK_USER_RESPONSE action (failure) | 0 |
| 562 | Admin Admin Store it handles a UNLINK_USER action | 0 |
| 563 | Admin Admin Store it handles a UNLINK_USER_RESPONSE action (success) | 1 |
| 564 | Admin Admin Store it handles a UNLINK_USER_RESPONSE action (failure) | 0 |
| 565 | Admin Admin Store it handles a SAVE_GROUP action | 1 |
| 566 | Admin Admin Store it handles a SAVE_GROUP_RESPONSE action (success) | 0 |
| 567 | Admin Admin Store it handles a SAVE_GROUP_RESPONSE action (failure) | 1 |
| 568 | Admin Admin Store it handles a DELETE action | 0 |
| 569 | Admin Admin Store it handles a SAVE_PERMISSIONS action | 1 |
| 570 | Admin Admin Store it handles a SAVE_PERMISSIONS_RESPONSE action (success) | 1 |
| 571 | Admin Admin Store it handles a SAVE_PERMISSIONS_RESPONSE action (failure) | 0 |
| 572 | Admin Admin Store it handles a DELETE action | 1 |
| 573 | Admin Admin Store it handles a DELETE_RESPONSE action (success) | 0 |
| 574 | Admin Admin Store it handles a DELETE_RESPONSE action (failure) | 1 |
| 575 | Admin Admin Store it handles validation errors (validation keys) | 0 |
| 576 | Admin Admin Store it handles validation errors (general) | 1 |
| 577 | Admin Admin Group Store it returns default state | 1 |
| 578 | Admin Admin Group Store it returns default results state | 1 |
| 579 | Admin Admin Group Store it returns default create new state | 2 |
| 580 | Admin Admin Group Store it returns default details state | 2 |
| 581 | Admin Admin Group Store it returns default permissions state | 0 |
| 582 | Admin Admin Group Store it returns default delete state | 1 |
| 583 | Admin Admin Group Store it returns default delete state | 0 |
| 584 | Admin Admin Group Store it handles a GET_RESULTS action | 1 |
| 585 | Admin Admin Group Store it handles a GET_RESULTS_RESPONSE action | 0 |
| 586 | Admin Admin Group Store it handles a SHOW_CREATE_NEW action | 1 |
| 587 | Admin Admin Group Store it handles a HIDE_CREATE_NEW action | 0 |
| 588 | Admin Admin Group Store it handles a CREATE_NEW action | 0 |
| 589 | Admin Admin Group Store it handles a CREATE_NEW_RESPONSE action (success) | 1 |
| 590 | Admin Admin Group Store it handles a CREATE_NEW_RESPONSE action (failure) | 0 |
| 591 | Admin Admin Group Store it handles a GET_DETAILS action | 1 |
| 592 | Admin Admin Group Store it handles a GET_DETAILS_RESPONSE action | 1 |
| 593 | Admin Admin Group Store it handles a SAVE_DETAILS action | 1 |
| 594 | Admin Admin Group Store it handles a SAVE_DETAILS_RESPONSE action (success) | 1 |
| 595 | Admin Admin Group Store it handles a SAVE_DETAILS_RESPONSE action (failure) | 0 |
| 596 | Admin Admin Group Store it handles a SAVE_PERMISSIONS action | 0 |
| 597 | Admin Admin Group Store it handles a SAVE_PERMISSIONS_RESPONSE action (success) | 1 |
| 598 | Admin Admin Group Store it handles a SAVE_PERMISSIONS_RESPONSE action (failure) | 1 |
| 599 | Admin Admin Group Store it handles a DELETE action | 0 |
| 600 | Admin Admin Group Store it handles a DELETE_RESPONSE action (success) | 0 |
| 601 | Admin Admin Group Store it handles a DELETE_RESPONSE action (failure) | 1 |
| 602 | Admin Admin Group Store it handles validation errors (validation keys) | 1 |
| 603 | Admin Admin Group Store it handles validation errors (general) | 0 |
| 604 | Admin Status Store it returns default state | 1 |
| 605 | Admin Status Store it returns default results state | 1 |
| 606 | Admin Status Store it returns default create new state | 2 |
| 607 | Admin Status Store it returns default details state | 2 |
| 608 | Admin Status Store it returns default delete state | 0 |
| 609 | Admin Status Store it handles a GET_RESULTS action | 1 |
| 610 | Admin Status Store it handles a GET_RESULTS_RESPONSE action | 0 |
| 611 | Admin Status Store it handles a SHOW_CREATE_NEW action | 1 |
| 612 | Admin Status Store it handles a HIDE_CREATE_NEW action | 0 |
| 613 | Admin Status Store it handles a CREATE_NEW action | 0 |
| 614 | Admin Status Store it handles a CREATE_NEW_RESPONSE action (success) | 1 |
| 615 | Admin Status Store it handles a CREATE_NEW_RESPONSE action (failure) | 1 |
| 616 | Admin Status Store it handles a GET_DETAILS action | 0 |
| 617 | Admin Status Store it handles a GET_DETAILS_RESPONSE action | 2 |
| 618 | Admin Status Store it handles a SAVE_DETAILS action | 0 |
| 619 | Admin Status Store it handles a SAVE_DETAILS_RESPONSE action (success) | 1 |
| 620 | Admin Status Store it handles a SAVE_DETAILS_RESPONSE action (failure) | 0 |
| 621 | Admin Status Store it handles a DELETE action | 1 |
| 622 | Admin Status Store it handles a DELETE_RESPONSE action (success) | 0 |
| 623 | Admin Status Store it handles a DELETE_RESPONSE action (failure) | 1 |
| 624 | Admin Status Store it handles validation errors (validation keys) | 1 |
| 625 | Admin Status Store it handles validation errors (general) | 0 |
| 626 | Admin User Store it returns default state | 1 |
| 627 | Admin User Store it returns default results state | 1 |
| 628 | Admin User Store it returns default create new state | 2 |
| 629 | Admin User Store it returns default identity state | 2 |
| 630 | Admin User Store it returns default password state | 0 |
| 631 | Admin User Store it returns default delete state | 3 |
| 632 | Admin User Store it handles a GET_RESULTS action | 1 |
| 633 | Admin User Store it handles a GET_RESULTS_RESPONSE action | 0 |
| 634 | Admin User Store it handles a SHOW_CREATE_NEW action | 1 |
| 635 | Admin User Store it handles a HIDE_CREATE_NEW action | 0 |
| 636 | Admin User Store it handles a CREATE_NEW action | 1 |
| 637 | Admin User Store it handles a CREATE_NEW_RESPONSE action (success) | 0 |
| 638 | Admin User Store it handles a CREATE_NEW_RESPONSE action (failure) | 0 |
| 639 | Admin User Store it handles a GET_IDENTITY action | 1 |
| 640 | Admin User Store it handles a GET_IDENTITY_RESPONSE action | 1 |
| 641 | Admin User Store it handles a SAVE_IDENTITY action | 1 |
| 642 | Admin User Store it handles a SAVE_IDENTITY_RESPONSE action (success) | 1 |
| 643 | Admin User Store it handles a SAVE_IDENTITY_RESPONSE action (failure) | 0 |
| 644 | Admin User Store it handles a SAVE_PASSWORD action | 0 |
| 645 | Admin User Store it handles a SAVE_PASSWORD_RESPONSE action (success) | 1 |
| 646 | Admin User Store it handles a SAVE_PASSWORD_RESPONSE action (failure) | 1 |
| 647 | Admin User Store it handles a DELETE action | 0 |
| 648 | Admin User Store it handles a DELETE_RESPONSE action (success) | 0 |
| 649 | Admin User Store it handles a DELETE_RESPONSE action (failure) | 1 |
| 650 | Admin User Store it handles validation errors (validation keys) | 1 |
| 651 | Admin User Store it handles validation errors (general) | 0 |
| 652 | Contact Actions it handles sendMessage successfully | 2 |
| 653 | Contact Actions it handles sendMessage when xhr fails | 2 |
| 654 | Contact Constants it loads | 0 |
| 655 | Contact Form it renders normally | 7 |
| 656 | Contact Form it handles unmounting | 7 |
| 657 | Contact Form it handles a store change | 10 |
| 658 | Contact Form it handles a submit event | 6 |
| 659 | Contact Form it renders with loading state | 19 |
| 660 | Contact Form it renders with success state | 13 |
| 661 | Contact Form it renders with error state | 44 |
| 662 | Contact Store it returns default state | 2 |
| 663 | Contact Store it handles a SEND_MESSAGE action | 0 |
| 664 | Contact Store it handles a SEND_MESSAGE_RESPONSE action (success) | 1 |
| 665 | Contact Store it handles a SEND_MESSAGE_RESPONSE action (validation errors) | 1 |
| 666 | Contact Store it handles a SEND_MESSAGE_RESPONSE action (other error) | 0 |
| 667 | Contact App it renders normally | 6 |
| 668 | Login Actions it handles forgot successfully | 2 |
| 669 | Login Actions it handles forgot when xhr fails | 1 |
| 670 | Login Actions it handles login successfully (redirect to returnUrl) | 3 |
| 671 | Login Actions it handles login successfully (redirect to admin) | 2 |
| 672 | Login Actions it handles login successfully (redirect to account) | 2 |
| 673 | Login Actions it handles login when xhr fails | 2 |
| 674 | Login Actions it handles logout successfully | 1 |
| 675 | Login Actions it handles logout when xhr fails | 2 |
| 676 | Login Actions it handles reset successfully | 2 |
| 677 | Login Actions it handles reset when xhr fails | 1 |
| 678 | Login Constants it loads | 0 |
| 679 | Login Routes it loads | 1 |
| 680 | Login App Component it renders normally | 3 |
| 681 | Login Forgot Form it renders normally | 5 |
| 682 | Login Forgot Form it handles unmounting | 5 |
| 683 | Login Forgot Form it handles a store change | 8 |
| 684 | Login Forgot Form it handles a submit event | 4 |
| 685 | Login Forgot Form it renders with loading state | 12 |
| 686 | Login Forgot Form it renders with success state | 13 |
| 687 | Login Forgot Form it renders with error state | 32 |
| 688 | Login Home Form it renders normally | 5 |
| 689 | Login Home Form it handles unmounting | 7 |
| 690 | Login Home Form it handles a store change | 9 |
| 691 | Login Home Form it handles a submit event | 5 |
| 692 | Login Home Form it renders with loading state | 15 |
| 693 | Login Home Form it renders with success state | 14 |
| 694 | Login Home Form it renders with error state | 31 |
| 695 | Login Logout Form it renders normally | 2 |
| 696 | Login Logout Form it handles unmounting | 2 |
| 697 | Login Logout Form it handles a store change | 2 |
| 698 | Login Logout Form it renders with success state | 10 |
| 699 | Login Logout Form it renders with error state | 5 |
| 700 | Login Not Found Component it renders normally | 2 |
| 701 | Login Not Found Component it handles unmounting | 1 |
| 702 | Login Reset Form it renders normally | 7 |
| 703 | Login Reset Form it handles unmounting | 7 |
| 704 | Login Reset Form it handles a store change | 11 |
| 705 | Login Reset Form it handles a submit event | 6 |
| 706 | Login Reset Form it renders with loading state | 17 |
| 707 | Login Reset Form it renders with success state | 17 |
| 708 | Login Reset Form it renders with error state | 44 |
| 709 | Login App it renders normally | 8 |
| 710 | Login Forgot Store it returns default state | 1 |
| 711 | Login Forgot Store it handles a FORGOT action | 1 |
| 712 | Login Forgot Store it handles a FORGOT_RESPONSE action (success) | 0 |
| 713 | Login Forgot Store it handles a FORGOT_RESPONSE action (validation errors) | 1 |
| 714 | Login Forgot Store it handles a FORGOT_RESPONSE action (other error) | 1 |
| 715 | Login Login Store it returns default state | 1 |
| 716 | Login Login Store it handles a LOGIN action | 1 |
| 717 | Login Login Store it handles a LOGIN_RESPONSE action (success) | 0 |
| 718 | Login Login Store it handles a LOGIN_RESPONSE action (validation errors) | 1 |
| 719 | Login Login Store it handles a LOGIN_RESPONSE action (other error) | 1 |
| 720 | Login Logout Store it returns default state | 1 |
| 721 | Login Logout Store it handles a LOGOUT action | 0 |
| 722 | Login Logout Store it handles a LOGOUT_RESPONSE action (success) | 1 |
| 723 | Login Logout Store it handles a LOGOUT_RESPONSE action (validation errors) | 0 |
| 724 | Login Logout Store it handles a LOGOUT_RESPONSE action (other error) | 1 |
| 725 | Login Reset Store it returns default state | 1 |
| 726 | Login Reset Store it handles a RESET action | 1 |
| 727 | Login Reset Store it handles a RESET_RESPONSE action (success) | 0 |
| 728 | Login Reset Store it handles a RESET_RESPONSE action (validation errors) | 1 |
| 729 | Login Reset Store it handles a RESET_RESPONSE action (other error) | 1 |
| 730 | Sign Up Actions it handles sendRequest successfully | 2 |
| 731 | Sign Up Actions it handles sendRequest when xhr fails | 2 |
| 732 | Sign Up Constants it loads | 0 |
| 733 | Sign Up Form it renders normally | 7 |
| 734 | Sign Up Form it handles unmounting | 8 |
| 735 | Sign Up Form it handles a store change | 12 |
| 736 | Sign Up Form it handles a submit event | 7 |
| 737 | Sign Up Form it renders with loading state | 20 |
| 738 | Sign Up Form it renders with success state | 19 |
| 739 | Sign Up Form it renders with error state | 40 |
| 740 | Sign Up Store it returns default state | 2 |
| 741 | Sign Up Store it handles a SEND_REQUEST action | 0 |
| 742 | Sign Up Store it handles a RECEIVE_RESPONSE action (success) | 1 |
| 743 | Sign Up Store it handles a RECEIVE_RESPONSE action (validation errors) | 0 |
| 744 | Sign Up Store it handles a RECEIVE_RESPONSE action (other error) | 1 |
| 745 | Sign Up App it renders normally | 7 |
| 746 | Config it gets config data | 1 |
| 747 | Config it gets config meta data | 0 |
| 748 | App it composes a server | 172 |
| 749 | Manifest it gets manifest data | 1 |
| 750 | Manifest it gets manifest meta data | 0 |
| 751 | Accounts Plugin Result List it returns an error when paged find fails | 10 |
| 752 | Accounts Plugin Result List it returns an array of documents successfully using filters | 5 |
| 753 | Accounts Plugin Result List it returns an array of documents successfully | 2 |
| 754 | Accounts Plugin Read it returns an error when find by id fails | 1 |
| 755 | Accounts Plugin Read it returns a not found when find by id misses | 1 |
| 756 | Accounts Plugin Read it returns a document successfully | 0 |
| 757 | Accounts Plugin (My) Read it returns an error when find by id fails | 0 |
| 758 | Accounts Plugin (My) Read it returns a not found when find by id misses | 0 |
| 759 | Accounts Plugin (My) Read it returns a document successfully | 0 |
| 760 | Accounts Plugin Create it returns an error when create fails | 4 |
| 761 | Accounts Plugin Create it creates a document successfully | 7 |
| 762 | Accounts Plugin Update it returns an error when update fails | 1 |
| 763 | Accounts Plugin Update it returns not found when find by id misses | 0 |
| 764 | Accounts Plugin Update it updates a document successfully | 1 |
| 765 | Accounts Plugin (My) Update it returns an error when update fails | 2 |
| 766 | Accounts Plugin (My) Update it updates a document successfully | 1 |
| 767 | Accounts Plugin Link User it returns an error when (Account) find by id fails | 2 |
| 768 | Accounts Plugin Link User it returns not found when (Account) find by id misses | 2 |
| 769 | Accounts Plugin Link User it returns an error when (User) find by username fails | 1 |
| 770 | Accounts Plugin Link User it returns not found when (User) find by username misses | 1 |
| 771 | Accounts Plugin Link User it returns conflict when an account role already exists | 2 |
| 772 | Accounts Plugin Link User it returns conflict when the account is linked to another user | 1 |
| 773 | Accounts Plugin Link User it returns an error when find by id and update fails | 2 |
| 774 | Accounts Plugin Link User it successfuly links an account and user | 1 |
| 775 | Accounts Plugin Add Note it returns an error when find by id and update fails | 1 |
| 776 | Accounts Plugin Add Note it successfully adds a note | 0 |
| 777 | Accounts Plugin Update Status it returns an error when find by id (Status) fails | 1 |
| 778 | Accounts Plugin Update Status it returns an error when find by id and update fails | 1 |
| 779 | Accounts Plugin Update Status it successfully updates the status | 2 |
| 780 | Accounts Plugin Unlink User it returns an error when (Account) find by id fails | 1 |
| 781 | Accounts Plugin Unlink User it returns not found when (Account) find by id misses | 1 |
| 782 | Accounts Plugin Unlink User it returns early account is void of a user | 1 |
| 783 | Accounts Plugin Unlink User it returns early account is void of a user.id | 1 |
| 784 | Accounts Plugin Unlink User it returns an error when (User) find by id fails | 1 |
| 785 | Accounts Plugin Unlink User it returns not found when (User) find by username misses | 2 |
| 786 | Accounts Plugin Unlink User it returns an error when find by id and update fails | 1 |
| 787 | Accounts Plugin Unlink User it successfully unlinks an account from a user | 1 |
| 788 | Accounts Plugin Delete it returns an error when delete by id fails | 1 |
| 789 | Accounts Plugin Delete it returns a not found when delete by id misses | 1 |
| 790 | Accounts Plugin Delete it deletes a document successfully | 1 |
| 791 | Admin Groups Plugin Result List it returns an error when paged find fails | 3 |
| 792 | Admin Groups Plugin Result List it returns an array of documents successfully | 2 |
| 793 | Admin Groups Plugin Result List it returns an array of documents successfully using filters | 1 |
| 794 | Admin Groups Plugin Read it returns an error when find by id fails | 1 |
| 795 | Admin Groups Plugin Read it returns a not found when find by id misses | 2 |
| 796 | Admin Groups Plugin Read it returns a document successfully | 1 |
| 797 | Admin Groups Plugin Create it returns an error when create fails | 1 |
| 798 | Admin Groups Plugin Create it creates a document successfully | 1 |
| 799 | Admin Groups Plugin Update it returns an error when update fails | 1 |
| 800 | Admin Groups Plugin Update it returns not found when find by id misses | 1 |
| 801 | Admin Groups Plugin Update it updates a document successfully | 1 |
| 802 | Admin Groups Plugin Update Permissions it returns an error when update fails | 1 |
| 803 | Admin Groups Plugin Update Permissions it updates a document successfully | 1 |
| 804 | Admin Groups Plugin Delete it returns an error when delete by id fails | 1 |
| 805 | Admin Groups Plugin Delete it returns a not found when delete by id misses | 1 |
| 806 | Admin Groups Plugin Delete it deletes a document successfully | 1 |
| 807 | Admins Plugin Result List it returns an error when paged find fails | 1 |
| 808 | Admins Plugin Result List it returns an array of documents successfully | 2 |
| 809 | Admins Plugin Result List it returns an array of documents successfully using filters | 1 |
| 810 | Admins Plugin Read it returns an error when find by id fails | 0 |
| 811 | Admins Plugin Read it returns a not found when find by id misses | 2 |
| 812 | Admins Plugin Read it returns a document successfully | 1 |
| 813 | Admins Plugin Create it returns an error when create fails | 1 |
| 814 | Admins Plugin Create it creates a document successfully | 2 |
| 815 | Admins Plugin Update it returns an error when update fails | 1 |
| 816 | Admins Plugin Update it returns not found when find by id misses | 2 |
| 817 | Admins Plugin Update it updates a document successfully | 1 |
| 818 | Admins Plugin Update Permissions it returns an error when update fails | 1 |
| 819 | Admins Plugin Update Permissions it updates a document successfully | 7 |
| 820 | Admins Plugin Update Groups it returns an error when update fails | 1 |
| 821 | Admins Plugin Update Groups it updates a document successfully | 2 |
| 822 | Admins Plugin Link User it returns an error when (Admin) find by id fails | 1 |
| 823 | Admins Plugin Link User it returns not found when (Admin) find by id misses | 1 |
| 824 | Admins Plugin Link User it returns an error when (User) find by username fails | 1 |
| 825 | Admins Plugin Link User it returns not found when (User) find by username misses | 1 |
| 826 | Admins Plugin Link User it returns conflict when an admin role already exists | 2 |
| 827 | Admins Plugin Link User it returns conflict when the admin is linked to another user | 1 |
| 828 | Admins Plugin Link User it returns an error when find by id and update fails | 1 |
| 829 | Admins Plugin Link User it successfuly links an admin and user | 1 |
| 830 | Admins Plugin Unlink User it returns an error when (Admin) find by id fails | 1 |
| 831 | Admins Plugin Unlink User it returns not found when (Admin) find by id misses | 1 |
| 832 | Admins Plugin Unlink User it returns early admin is void of a user | 0 |
| 833 | Admins Plugin Unlink User it returns early admin is void of a user.id | 1 |
| 834 | Admins Plugin Unlink User it returns an error when (User) find by id fails | 1 |
| 835 | Admins Plugin Unlink User it returns not found when (User) find by username misses | 1 |
| 836 | Admins Plugin Unlink User it returns an error when find by id and update fails | 2 |
| 837 | Admins Plugin Unlink User it successfully unlinks an admin from a user | 1 |
| 838 | Admins Plugin Delete it returns an error when delete by id fails | 1 |
| 839 | Admins Plugin Delete it returns a not found when delete by id misses | 1 |
| 840 | Admins Plugin Delete it deletes a document successfully | 1 |
| 841 | Auth Attempts Plugin Result List it returns an error when paged find fails | 2 |
| 842 | Auth Attempts Plugin Result List it returns an array of documents successfully | 2 |
| 843 | Auth Attempts Plugin Read it returns an error when find by id fails | 1 |
| 844 | Auth Attempts Plugin Read it returns a not found when find by id misses | 2 |
| 845 | Auth Attempts Plugin Read it returns a document successfully | 1 |
| 846 | Auth Attempt Plugin Delete it returns an error when delete by id fails | 2 |
| 847 | Auth Attempt Plugin Delete it returns a not found when delete by id misses | 1 |
| 848 | Auth Attempt Plugin Delete it deletes a document successfully | 2 |
| 849 | Contact Plugin it returns an error when send email fails | 3 |
| 850 | Contact Plugin it returns success after sending an email | 2 |
| 851 | Index Plugin it returns the default message | 1 |
| 852 | Login Plugin (Create Session) it returns an error when detecting abuse fails | 5 |
| 853 | Login Plugin (Create Session) it returns early when abuse is detected | 2 |
| 854 | Login Plugin (Create Session) it returns an error when find by credentials fails | 1 |
| 855 | Login Plugin (Create Session) it returns an error when creating a new auth attempt fails | 1 |
| 856 | Login Plugin (Create Session) it returns early after creating a new auth attempt | 2 |
| 857 | Login Plugin (Create Session) it returns an error when creating a new session fails | 2 |
| 858 | Login Plugin (Create Session) it returns a session successfully | 4 |
| 859 | Login Plugin Forgot Password it returns an error when find one fails | 1 |
| 860 | Login Plugin Forgot Password it returns early when find one misses | 1 |
| 861 | Login Plugin Forgot Password it returns an error if any critical step fails | 66 |
| 862 | Login Plugin Forgot Password it succussfully sends a reset password request | 64 |
| 863 | Login Plugin Reset Password it returns an error when find one fails | 2 |
| 864 | Login Plugin Reset Password it returns a bad request when find one misses | 0 |
| 865 | Login Plugin Reset Password it returns an error if any critical step fails | 2 |
| 866 | Login Plugin Reset Password it returns a bad request if the key does not match | 1 |
| 867 | Login Plugin Reset Password it succussfully sets a password | 63 |
| 868 | Logout Plugin (Delete Session) it returns an error when delete fails | 1 |
| 869 | Logout Plugin (Delete Session) it returns a not found when delete misses (no credentials) | 1 |
| 870 | Logout Plugin (Delete Session) it returns a not found when delete misses (missing user from credentials) | 1 |
| 871 | Logout Plugin (Delete Session) it deletes the authenticated user session successfully | 2 |
| 872 | Session Plugin Result List it returns an error when paged find fails | 2 |
| 873 | Session Plugin Result List it returns an array of documents successfully | 1 |
| 874 | Session Plugin Read it returns an error when find by id fails | 1 |
| 875 | Session Plugin Read it returns a not found when find by id misses | 2 |
| 876 | Session Plugin Read it returns a document successfully | 2 |
| 877 | Session Plugin Delete it returns an error when delete by id fails | 1 |
| 878 | Session Plugin Delete it returns a not found when delete by id misses | 2 |
| 879 | Session Plugin Delete it deletes a document successfully | 2 |
| 880 | Signup Plugin it returns an error when find one fails for username check | 3 |
| 881 | Signup Plugin it returns a conflict when find one hits for username check | 2 |
| 882 | Signup Plugin it returns an error when find one fails for email check | 8 |
| 883 | Signup Plugin it returns a conflict when find one hits for email check | 2 |
| 884 | Signup Plugin it returns an error if any critical setup step fails | 4 |
| 885 | Signup Plugin it finishes successfully (even if sending welcome email fails) | 2 |
| 886 | Signup Plugin it finishes successfully | 4 |
| 887 | Statuses Plugin Result List it returns an error when paged find fails | 2 |
| 888 | Statuses Plugin Result List it returns an array of documents successfully | 1 |
| 889 | Statuses Plugin Result List it returns an array of documents successfully using filters | 1 |
| 890 | Statuses Plugin Read it returns an error when find by id fails | 1 |
| 891 | Statuses Plugin Read it returns a not found when find by id misses | 1 |
| 892 | Statuses Plugin Read it returns a document successfully | 1 |
| 893 | Statuses Plugin Create it returns an error when create fails | 1 |
| 894 | Statuses Plugin Create it creates a document successfully | 1 |
| 895 | Statuses Plugin Update it returns an error when update fails | 1 |
| 896 | Statuses Plugin Update it returns not found when find by id misses | 0 |
| 897 | Statuses Plugin Update it updates a document successfully | 1 |
| 898 | Statuses Plugin Delete it returns an error when delete by id fails | 0 |
| 899 | Statuses Plugin Delete it returns a not found when delete by id misses | 1 |
| 900 | Statuses Plugin Delete it deletes a document successfully | 0 |
| 901 | User Plugin Result List it returns an error when paged find fails | 9 |
| 902 | User Plugin Result List it returns an array of documents successfully | 1 |
| 903 | User Plugin Result List it returns an array of documents successfully using filters | 2 |
| 904 | Users Plugin Read it returns an error when find by id fails | 1 |
| 905 | Users Plugin Read it returns a not found when find by id misses | 1 |
| 906 | Users Plugin Read it returns a document successfully | 1 |
| 907 | Users Plugin (My) Read it returns an error when find by id fails | 1 |
| 908 | Users Plugin (My) Read it returns a not found when find by id misses | 1 |
| 909 | Users Plugin (My) Read it returns a document successfully | 1 |
| 910 | Users Plugin Create it returns an error when find one fails for username check | 1 |
| 911 | Users Plugin Create it returns a conflict when find one hits for username check | 1 |
| 912 | Users Plugin Create it returns an error when find one fails for email check | 1 |
| 913 | Users Plugin Create it returns a conflict when find one hits for email check | 1 |
| 914 | Users Plugin Create it returns an error when create fails | 1 |
| 915 | Users Plugin Create it creates a document successfully | 1 |
| 916 | Users Plugin Update it returns an error when find one fails for username check | 2 |
| 917 | Users Plugin Update it returns a conflict when find one hits for username check | 1 |
| 918 | Users Plugin Update it returns an error when find one fails for email check | 1 |
| 919 | Users Plugin Update it returns a conflict when find one hits for email check | 1 |
| 920 | Users Plugin Update it returns an error when update fails | 1 |
| 921 | Users Plugin Update it returns not found when find by id misses | 1 |
| 922 | Users Plugin Update it updates a document successfully | 1 |
| 923 | Users Plugin (My) Update it returns an error when find one fails for username check | 1 |
| 924 | Users Plugin (My) Update it returns a conflict when find one hits for username check | 1 |
| 925 | Users Plugin (My) Update it returns an error when find one fails for email check | 1 |
| 926 | Users Plugin (My) Update it returns a conflict when find one hits for email check | 1 |
| 927 | Users Plugin (My) Update it returns an error when update fails | 1 |
| 928 | Users Plugin (My) Update it updates a document successfully | 2 |
| 929 | Users Plugin Set Password it returns an error when generate password hash fails | 3 |
| 930 | Users Plugin Set Password it returns an error when update fails | 1 |
| 931 | Users Plugin Set Password it sets the password successfully | 1 |
| 932 | Users Plugin (My) Set Password it returns an error when generate password hash fails | 1 |
| 933 | Users Plugin (My) Set Password it returns an error when update fails | 1 |
| 934 | Users Plugin (My) Set Password it sets the password successfully | 1 |
| 935 | Users Plugin Delete it returns an error when delete by id fails | 2 |
| 936 | Users Plugin Delete it returns a not found when delete by id misses | 1 |
| 937 | Users Plugin Delete it deletes a document successfully | 1 |
| 938 | Auth Plugin it returns authentication credentials | 7 |
| 939 | Auth Plugin it returns an error when the session is not found | 4 |
| 940 | Auth Plugin it returns an error when the user is not found | 11 |
| 941 | Auth Plugin it returns an error when a model error occurs | 4 |
| 942 | Auth Plugin it takes over when the required role is missing | 4 |
| 943 | Auth Plugin it continues through pre handler when role is present | 5 |
| 944 | Auth Plugin it takes over when the required group is missing | 5 |
| 945 | Auth Plugin it continues through pre handler when group is present | 3 |
| 946 | Mailer Plugin it successfuly registers itself | 1 |
| 947 | Mailer Plugin it returns error when read file fails | 1 |
| 948 | Mailer Plugin it sends an email | 7 |
| 949 | Mailer Plugin it returns early with the template is cached | 1 |
| 950 | Account Class Methods it returns a new instance when create succeeds | 6 |
| 951 | Account Class Methods it correctly sets the middle name when create is called | 5 |
| 952 | Account Class Methods it returns an error when create fails | 1 |
| 953 | Account Class Methods it returns a result when finding by username | 4 |
| 954 | AdminGroup Class Methods it returns a new instance when create succeeds | 4 |
| 955 | AdminGroup Class Methods it returns an error when create fails | 1 |
| 956 | AdminGroup Instance Methods it returns false when permissions are not found | 4 |
| 957 | AdminGroup Instance Methods it returns boolean values for set permissions | 4 |
| 958 | Admin Class Methods it returns a new instance when create succeeds | 3 |
| 959 | Admin Class Methods it correctly sets the middle name when create is called | 3 |
| 960 | Admin Class Methods it returns an error when create fails | 2 |
| 961 | Admin Class Methods it returns a result when finding by username | 6 |
| 962 | Admin Instance Methods it returns false when groups are not found | 1 |
| 963 | Admin Instance Methods it returns boolean values for set group memberships | 0 |
| 964 | Admin Instance Methods it exits early when hydrating groups where groups are missing | 1 |
| 965 | Admin Instance Methods it exits early when hydrating groups where hydrated groups exist | 0 |
| 966 | Admin Instance Methods it returns an error when hydrating groups and find by id fails | 1 |
| 967 | Admin Instance Methods it successfully hydrates groups | 2 |
| 968 | Admin Instance Methods it exits early when the permission exists on the admin | 1 |
| 969 | Admin Instance Methods it returns an error when checking permission and hydrating groups fails | 1 |
| 970 | Admin Instance Methods it returns correct permission from hydrated group permissions | 2 |
| 971 | AuthAttempt Class Methods it returns a new instance when create succeeds | 4 |
| 972 | AuthAttempt Class Methods it returns an error when create fails | 1 |
| 973 | AuthAttempt Class Methods it returns false when abuse is not detected | 3 |
| 974 | AuthAttempt Class Methods it returns true when abuse is detected for user + ip combo | 20 |
| 975 | AuthAttempt Class Methods it returns true when abuse is detected for an ip and multiple users | 75 |
| 976 | AuthAttempt Class Methods it returns an error when count fails | 1 |
| 977 | Status Entry Class it instantiates an instance | 0 |
| 978 | Session Class Methods it creates a key hash combination | 64 |
| 979 | Session Class Methods it returns an error when key hash fails | 2 |
| 980 | Session Class Methods it returns a new instance when create succeeds | 65 |
| 981 | Session Class Methods it returns an error when create fails | 64 |
| 982 | Session Class Methods it returns a result when finding by credentials | 133 |
| 983 | Session Class Methods it returns nothing for find by credentials when key match fails | 1 |
| 984 | Session Class Methods it returns an error when finding by credentials fails | 1 |
| 985 | Session Class Methods it returns early when finding by credentials misses | 1 |
| 986 | Status Entry Class it instantiates an instance | 1 |
| 987 | Status Class Methods it returns a new instance when create succeeds | 9 |
| 988 | Status Class Methods it returns an error when create fails | 3 |
| 989 | User Class Methods it creates a password hash combination | 64 |
| 990 | User Class Methods it returns an error when password hash fails | 1 |
| 991 | User Class Methods it returns a new instance when create succeeds | 67 |
| 992 | User Class Methods it returns an error when create fails | 63 |
| 993 | User Class Methods it returns a result when finding by login | 134 |
| 994 | User Class Methods it returns nothing for find by credentials when password match fails | 3 |
| 995 | User Class Methods it returns early when finding by login misses | 1 |
| 996 | User Class Methods it returns an error when finding by login fails | 2 |
| 997 | User Class Methods it returns a result when finding by username | 66 |
| 998 | User Instance Methods it returns false when roles are missing | 0 |
| 999 | User Instance Methods it returns correctly for the specified role | 1 |
| 1000 | User Instance Methods it exits early when hydrating roles where roles are missing | 0 |
| 1001 | User Instance Methods it exits early when hydrating roles where hydrated roles exist | 1 |
| 1002 | User Instance Methods it returns an error when hydrating roles and find by id fails | 1 |
| 1003 | User Instance Methods it returns successful when hydrating roles | 0 |
| 1004 | User Instance Methods it returns successful when hydrating roles where there are none defined | 1 |
| 1005 | About Page View about page renders properly | 128 |
| 1006 | Account Page View Account page renders properly | 27 |
| 1007 | Admin Page View Admin page renders properly | 25 |
| 1008 | Contact Page View contact page renders properly | 66 |
| 1009 | Home Page View home page renders properly | 55 |
| 1010 | Login Page View it renders properly | 51 |
| 1011 | Login Page View it redirects to /admin when user is authenticated as an admin | 2 |
| 1012 | Login Page View it redirects to /account when user is authenticated as an account | 1 |
| 1013 | Login Page View it does not redirect when user is authenticated if the path is logout | 46 |
| 1014 | Sign Up Page View Sign Up page renders properly | 40 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Confidence = require('confidence'); |
| 2 | ||
| 3 | ||
| 4 | 1 | var criteria = { |
| 5 | env: process.env.NODE_ENV | |
| 6 | }; | |
| 7 | ||
| 8 | ||
| 9 | 1 | var config = { |
| 10 | $meta: 'This file configures the plot device.', | |
| 11 | projectName: 'Tasks', | |
| 12 | port: { | |
| 13 | web: { | |
| 14 | $filter: 'env', | |
| 15 | test: 9000, | |
| 16 | production: process.env.PORT, | |
| 17 | $default: 8000 | |
| 18 | } | |
| 19 | }, | |
| 20 | baseUrl: { | |
| 21 | $filter: 'env', | |
| 22 | $meta: 'values should not end in "/"', | |
| 23 | production: 'https://getaqua.herokuapp.com', | |
| 24 | $default: 'http://127.0.0.1:8000' | |
| 25 | }, | |
| 26 | authAttempts: { | |
| 27 | forIp: 50, | |
| 28 | forIpAndUser: 7 | |
| 29 | }, | |
| 30 | cookieSecret: { | |
| 31 | $filter: 'env', | |
| 32 | production: process.env.COOKIE_SECRET, | |
| 33 | $default: '~k3yb04rdK4tz!' | |
| 34 | }, | |
| 35 | hapiMongoModels: { | |
| 36 | $filter: 'env', | |
| 37 | production: { | |
| 38 | mongodb: { | |
| 39 | url: process.env.MONGOLAB_URI | |
| 40 | }, | |
| 41 | autoIndex: false | |
| 42 | }, | |
| 43 | test: { | |
| 44 | mongodb: { | |
| 45 | url: 'mongodb://localhost:27017/tasks-test' | |
| 46 | }, | |
| 47 | autoIndex: true | |
| 48 | }, | |
| 49 | $default: { | |
| 50 | mongodb: { | |
| 51 | url: 'mongodb://localhost:27017/tasks' | |
| 52 | }, | |
| 53 | autoIndex: true | |
| 54 | } | |
| 55 | }, | |
| 56 | nodemailer: { | |
| 57 | host: 'smtp.gmail.com', | |
| 58 | port: 465, | |
| 59 | secure: true, | |
| 60 | auth: { | |
| 61 | user: 'developer.pht@gmail.com', | |
| 62 | pass: 'phtdeveloper' | |
| 63 | } | |
| 64 | }, | |
| 65 | system: { | |
| 66 | fromAddress: { | |
| 67 | name: 'Tasks', | |
| 68 | address: 'developer.pht@gmail.com' | |
| 69 | }, | |
| 70 | toAddress: { | |
| 71 | name: 'Tasks', | |
| 72 | address: 'developer.pht@gmail.com' | |
| 73 | } | |
| 74 | } | |
| 75 | }; | |
| 76 | ||
| 77 | ||
| 78 | 1 | var store = new Confidence.Store(config); |
| 79 | ||
| 80 | ||
| 81 | 1 | exports.get = function (key) { |
| 82 | ||
| 83 | 81 | return store.get(key, criteria); |
| 84 | }; | |
| 85 | ||
| 86 | ||
| 87 | 1 | exports.meta = function (key) { |
| 88 | ||
| 89 | 1 | return store.meta(key, criteria); |
| 90 | }; | |
| 91 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Glue = require('glue'); |
| 2 | 1 | var Manifest = require('./manifest'); |
| 3 | ||
| 4 | ||
| 5 | 1 | var composeOptions = { |
| 6 | relativeTo: __dirname | |
| 7 | }; | |
| 8 | ||
| 9 | ||
| 10 | 1 | module.exports = Glue.compose.bind(Glue, Manifest.get('/'), composeOptions); |
| 11 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Confidence = require('confidence'); |
| 2 | 1 | var Config = require('./config'); |
| 3 | ||
| 4 | ||
| 5 | 1 | var criteria = { |
| 6 | env: process.env.NODE_ENV | |
| 7 | }; | |
| 8 | ||
| 9 | ||
| 10 | 1 | var manifest = { |
| 11 | $meta: 'This file defines the plot device.', | |
| 12 | server: { | |
| 13 | debug: { | |
| 14 | request: ['error'] | |
| 15 | }, | |
| 16 | connections: { | |
| 17 | routes: { | |
| 18 | security: true | |
| 19 | } | |
| 20 | } | |
| 21 | }, | |
| 22 | connections: [{ | |
| 23 | port: Config.get('/port/web'), | |
| 24 | labels: ['web'] | |
| 25 | }], | |
| 26 | plugins: { | |
| 27 | 'hapi-auth-basic': {}, | |
| 28 | 'hapi-auth-cookie': {}, | |
| 29 | 'crumb': { | |
| 30 | restful: true | |
| 31 | }, | |
| 32 | 'lout': {}, | |
| 33 | 'visionary': { | |
| 34 | engines: { | |
| 35 | jsx: 'hapi-react-views' | |
| 36 | }, | |
| 37 | relativeTo: __dirname, | |
| 38 | path: './server/web' | |
| 39 | }, | |
| 40 | 'hapi-mongo-models': { | |
| 41 | mongodb: Config.get('/hapiMongoModels/mongodb'), | |
| 42 | models: { | |
| 43 | Account: './server/models/account', | |
| 44 | AdminGroup: './server/models/admin-group', | |
| 45 | Admin: './server/models/admin', | |
| 46 | AuthAttempt: './server/models/auth-attempt', | |
| 47 | Session: './server/models/session', | |
| 48 | Status: './server/models/status', | |
| 49 | User: './server/models/user' | |
| 50 | }, | |
| 51 | autoIndex: Config.get('/hapiMongoModels/autoIndex') | |
| 52 | }, | |
| 53 | './server/auth': {}, | |
| 54 | './server/mailer': {}, | |
| 55 | './server/api/accounts': { basePath: '/api' }, | |
| 56 | './server/api/admin-groups': { basePath: '/api' }, | |
| 57 | './server/api/admins': { basePath: '/api' }, | |
| 58 | './server/api/auth-attempts': { basePath: '/api' }, | |
| 59 | './server/api/contact': { basePath: '/api' }, | |
| 60 | './server/api/index': { basePath: '/api' }, | |
| 61 | './server/api/login': { basePath: '/api' }, | |
| 62 | './server/api/logout': { basePath: '/api' }, | |
| 63 | './server/api/sessions': { basePath: '/api' }, | |
| 64 | './server/api/signup': { basePath: '/api' }, | |
| 65 | './server/api/statuses': { basePath: '/api' }, | |
| 66 | './server/api/users': { basePath: '/api' }, | |
| 67 | './server/web/about': {}, | |
| 68 | './server/web/account': {}, | |
| 69 | './server/web/admin': {}, | |
| 70 | './server/web/contact': {}, | |
| 71 | './server/web/home': {}, | |
| 72 | './server/web/login': {}, | |
| 73 | './server/web/public': {}, | |
| 74 | './server/web/signup': {} | |
| 75 | } | |
| 76 | }; | |
| 77 | ||
| 78 | ||
| 79 | 1 | var store = new Confidence.Store(manifest); |
| 80 | ||
| 81 | ||
| 82 | 1 | exports.get = function (key) { |
| 83 | ||
| 84 | 23 | return store.get(key, criteria); |
| 85 | }; | |
| 86 | ||
| 87 | ||
| 88 | 1 | exports.meta = function (key) { |
| 89 | ||
| 90 | 1 | return store.meta(key, criteria); |
| 91 | }; | |
| 92 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('../constants/Redirect'); |
| 4 | ||
| 5 | ||
| 6 | 1 | var ActionTypes = Constants.ActionTypes; |
| 7 | 1 | var dispatch = Dispatcher.handleAction; |
| 8 | ||
| 9 | ||
| 10 | 1 | var Actions = { |
| 11 | saveReturnUrl: function (data) { | |
| 12 | ||
| 13 | 2 | dispatch(ActionTypes.SAVE_RETURN_URL, data); |
| 14 | ||
| 15 | 2 | var returnUrl = window.location.pathname; |
| 16 | 2 | if (window.location.search.length > 0) { |
| 17 | 1 | returnUrl += window.location.search; |
| 18 | } | |
| 19 | ||
| 20 | 2 | window.localStorage.setItem('returnUrl', returnUrl); |
| 21 | ||
| 22 | 2 | dispatch(ActionTypes.SAVE_RETURN_URL_RESPONSE, data); |
| 23 | }, | |
| 24 | clearReturnUrl: function (data) { | |
| 25 | ||
| 26 | 1 | dispatch(ActionTypes.CLEAR_RETURN_URL, data); |
| 27 | ||
| 28 | 1 | window.localStorage.removeItem('returnUrl'); |
| 29 | ||
| 30 | 1 | dispatch(ActionTypes.CLEAR_RETURN_URL_RESPONSE, data); |
| 31 | } | |
| 32 | }; | |
| 33 | ||
| 34 | ||
| 35 | 1 | module.exports = Actions; |
| 36 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global document, window */ | client/components/Modal.jsx | 1 | |
| 2 | 'use strict'; | client/components/Modal.jsx | 2 | |
| 3 | client/components/Modal.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/components/Modal.jsx | 2 |
| 5 | 1 | var ClassNames = require('classnames'); | client/components/Modal.jsx | 3 |
| 6 | client/components/Modal.jsx | 3 | ||
| 7 | 1 | var Component = React.createClass({ | client/components/Modal.jsx | 6 |
| 8 | displayName: 'Component', | client/components/Modal.jsx | 6 | |
| 9 | client/components/Modal.jsx | 6 | ||
| 10 | getInitialState: function getInitialState() { | client/components/Modal.jsx | 7 | |
| 11 | client/components/Modal.jsx | 7 | ||
| 12 | 84 | return { | client/components/Modal.jsx | 9 |
| 13 | bgHeight: window.innerHeight | client/components/Modal.jsx | 10 | |
| 14 | }; | client/components/Modal.jsx | 10 | |
| 15 | }, | client/components/Modal.jsx | 11 | |
| 16 | getDefaultProps: function getDefaultProps() { | client/components/Modal.jsx | 13 | |
| 17 | client/components/Modal.jsx | 13 | ||
| 18 | 1 | return { | client/components/Modal.jsx | 15 |
| 19 | data: {} | client/components/Modal.jsx | 16 | |
| 20 | }; | client/components/Modal.jsx | 16 | |
| 21 | }, | client/components/Modal.jsx | 17 | |
| 22 | componentDidMount: function componentDidMount() { | client/components/Modal.jsx | 19 | |
| 23 | client/components/Modal.jsx | 19 | ||
| 24 | 84 | window.addEventListener('resize', this.onWindowResize); | client/components/Modal.jsx | 21 |
| 25 | }, | client/components/Modal.jsx | 21 | |
| 26 | componentWillUnmount: function componentWillUnmount() { | client/components/Modal.jsx | 23 | |
| 27 | client/components/Modal.jsx | 23 | ||
| 28 | 11 | window.removeEventListener('resize', this.onWindowResize); | client/components/Modal.jsx | 25 |
| 29 | 11 | document.removeEventListener('keyup', this.onKeyUp); | client/components/Modal.jsx | 26 |
| 30 | 11 | document.body.classList.remove('modal-open'); | client/components/Modal.jsx | 27 |
| 31 | }, | client/components/Modal.jsx | 27 | |
| 32 | componentWillUpdate: function componentWillUpdate(nextProps, nextState) { | client/components/Modal.jsx | 29 | |
| 33 | client/components/Modal.jsx | 29 | ||
| 34 | 48 | if (nextProps.show) { | client/components/Modal.jsx | 31 |
| 35 | 6 | document.addEventListener('keyup', this.onKeyUp); | client/components/Modal.jsx | 32 |
| 36 | 6 | document.body.classList.add('modal-open'); | client/components/Modal.jsx | 33 |
| 37 | } else { | client/components/Modal.jsx | 33 | |
| 38 | 42 | document.removeEventListener('keyup', this.onKeyUp); | client/components/Modal.jsx | 36 |
| 39 | 42 | document.body.classList.remove('modal-open'); | client/components/Modal.jsx | 37 |
| 40 | } | client/components/Modal.jsx | 37 | |
| 41 | }, | client/components/Modal.jsx | 38 | |
| 42 | onWindowResize: function onWindowResize() { | client/components/Modal.jsx | 40 | |
| 43 | client/components/Modal.jsx | 40 | ||
| 44 | 1 | this.setState({ bgHeight: window.innerHeight }); | client/components/Modal.jsx | 42 |
| 45 | }, | client/components/Modal.jsx | 42 | |
| 46 | onBackdropClick: function onBackdropClick(event) { | client/components/Modal.jsx | 44 | |
| 47 | client/components/Modal.jsx | 44 | ||
| 48 | 2 | if (event.target === event.currentTarget) { | client/components/Modal.jsx | 46 |
| 49 | 1 | this.props.onClose(); | client/components/Modal.jsx | 47 |
| 50 | } | client/components/Modal.jsx | 47 | |
| 51 | }, | client/components/Modal.jsx | 48 | |
| 52 | onKeyUp: function onKeyUp(event) { | client/components/Modal.jsx | 50 | |
| 53 | client/components/Modal.jsx | 50 | ||
| 54 | 2 | if (event.which === 27) { | client/components/Modal.jsx | 52 |
| 55 | 1 | this.props.onClose(); | client/components/Modal.jsx | 53 |
| 56 | } | client/components/Modal.jsx | 53 | |
| 57 | }, | client/components/Modal.jsx | 54 | |
| 58 | render: function render() { | client/components/Modal.jsx | 56 | |
| 59 | client/components/Modal.jsx | 56 | ||
| 60 | 132 | var modalClasses = ClassNames({ | client/components/Modal.jsx | 58 |
| 61 | modal: true | client/components/Modal.jsx | 59 | |
| 62 | }); | client/components/Modal.jsx | 59 | |
| 63 | client/components/Modal.jsx | 60 | ||
| 64 | 132 | var modalStyles = {}; | client/components/Modal.jsx | 62 |
| 65 | 132 | if (this.props.show) { | client/components/Modal.jsx | 63 |
| 66 | 6 | modalStyles.display = 'block'; | client/components/Modal.jsx | 64 |
| 67 | } | client/components/Modal.jsx | 64 | |
| 68 | client/components/Modal.jsx | 65 | ||
| 69 | 132 | var modalBgStyles = { | client/components/Modal.jsx | 67 |
| 70 | height: this.state.bgHeight + 'px', | client/components/Modal.jsx | 68 | |
| 71 | top: document.body.scrollTop + 'px' | client/components/Modal.jsx | 69 | |
| 72 | }; | client/components/Modal.jsx | 69 | |
| 73 | client/components/Modal.jsx | 70 | ||
| 74 | 132 | var containerStyles = { display: 'none' }; | client/components/Modal.jsx | 72 |
| 75 | 132 | if (this.props.show) { | client/components/Modal.jsx | 73 |
| 76 | 6 | containerStyles.display = 'block'; | client/components/Modal.jsx | 74 |
| 77 | } | client/components/Modal.jsx | 74 | |
| 78 | client/components/Modal.jsx | 75 | ||
| 79 | 132 | var modalHeader; | client/components/Modal.jsx | 77 |
| 80 | 132 | if (this.props.header) { | client/components/Modal.jsx | 78 |
| 81 | 121 | modalHeader = React.createElement( | client/components/Modal.jsx | 79 |
| 82 | 'div', | client/components/Modal.jsx | 79 | |
| 83 | { className: 'modal-header' }, | client/components/Modal.jsx | 79 | |
| 84 | React.createElement( | client/components/Modal.jsx | 79 | |
| 85 | 'button', | client/components/Modal.jsx | 80 | |
| 86 | { type: 'button', className: 'close', onClick: this.props.onClose }, | client/components/Modal.jsx | 80 | |
| 87 | '×' | client/components/Modal.jsx | 80 | |
| 88 | ), | client/components/Modal.jsx | 80 | |
| 89 | React.createElement( | client/components/Modal.jsx | 82 | |
| 90 | 'h4', | client/components/Modal.jsx | 83 | |
| 91 | { className: 'modal-title' }, | client/components/Modal.jsx | 83 | |
| 92 | this.props.header | client/components/Modal.jsx | 83 | |
| 93 | ) | client/components/Modal.jsx | 83 | |
| 94 | ); | client/components/Modal.jsx | 83 | |
| 95 | } | client/components/Modal.jsx | 84 | |
| 96 | client/components/Modal.jsx | 85 | ||
| 97 | 132 | var modalFooter; | client/components/Modal.jsx | 87 |
| 98 | 132 | if (this.props.footer) { | client/components/Modal.jsx | 88 |
| 99 | 1 | modalFooter = React.createElement( | client/components/Modal.jsx | 89 |
| 100 | 'div', | client/components/Modal.jsx | 89 | |
| 101 | { className: 'modal-footer' }, | client/components/Modal.jsx | 89 | |
| 102 | this.props.footer | client/components/Modal.jsx | 89 | |
| 103 | ); | client/components/Modal.jsx | 90 | |
| 104 | } | client/components/Modal.jsx | 91 | |
| 105 | client/components/Modal.jsx | 92 | ||
| 106 | 132 | return React.createElement( | client/components/Modal.jsx | 94 |
| 107 | 'div', | client/components/Modal.jsx | 95 | |
| 108 | { style: containerStyles }, | client/components/Modal.jsx | 95 | |
| 109 | React.createElement('div', { | client/components/Modal.jsx | 95 | |
| 110 | ref: 'backdrop', | client/components/Modal.jsx | 97 | |
| 111 | className: 'modal-backdrop in', | client/components/Modal.jsx | 98 | |
| 112 | style: modalBgStyles }), | client/components/Modal.jsx | 99 | |
| 113 | React.createElement( | client/components/Modal.jsx | 100 | |
| 114 | 'div', | client/components/Modal.jsx | 101 | |
| 115 | { | client/components/Modal.jsx | 101 | |
| 116 | ref: 'modal', | client/components/Modal.jsx | 102 | |
| 117 | style: modalStyles, | client/components/Modal.jsx | 103 | |
| 118 | className: modalClasses, | client/components/Modal.jsx | 104 | |
| 119 | onClick: this.onBackdropClick }, | client/components/Modal.jsx | 105 | |
| 120 | React.createElement( | client/components/Modal.jsx | 105 | |
| 121 | 'div', | client/components/Modal.jsx | 107 | |
| 122 | { ref: 'dialog', className: 'modal-dialog' }, | client/components/Modal.jsx | 107 | |
| 123 | React.createElement( | client/components/Modal.jsx | 107 | |
| 124 | 'div', | client/components/Modal.jsx | 108 | |
| 125 | { className: 'modal-content' }, | client/components/Modal.jsx | 108 | |
| 126 | modalHeader, | client/components/Modal.jsx | 108 | |
| 127 | React.createElement( | client/components/Modal.jsx | 109 | |
| 128 | 'div', | client/components/Modal.jsx | 110 | |
| 129 | { className: 'modal-body' }, | client/components/Modal.jsx | 110 | |
| 130 | this.props.children | client/components/Modal.jsx | 110 | |
| 131 | ), | client/components/Modal.jsx | 111 | |
| 132 | modalFooter | client/components/Modal.jsx | 112 | |
| 133 | ) | client/components/Modal.jsx | 113 | |
| 134 | ) | client/components/Modal.jsx | 114 | |
| 135 | ) | client/components/Modal.jsx | 115 | |
| 136 | ); | client/components/Modal.jsx | 116 | |
| 137 | } | client/components/Modal.jsx | 118 | |
| 138 | }); | client/components/Modal.jsx | 119 | |
| 139 | client/components/Modal.jsx | 120 | ||
| 140 | 1 | module.exports = Component; | client/components/Modal.jsx | 123 |
| 141 | client/components/Modal.jsx | 123 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | "use strict"; | client/components/Paging.jsx | 1 | |
| 2 | client/components/Paging.jsx | 2 | ||
| 3 | 1 | var React = require("react/addons"); | client/components/Paging.jsx | 1 |
| 4 | client/components/Paging.jsx | 1 | ||
| 5 | 1 | var Component = React.createClass({ | client/components/Paging.jsx | 4 |
| 6 | displayName: "Component", | client/components/Paging.jsx | 4 | |
| 7 | client/components/Paging.jsx | 4 | ||
| 8 | onPrevPage: function onPrevPage() { | client/components/Paging.jsx | 5 | |
| 9 | client/components/Paging.jsx | 5 | ||
| 10 | 1 | this.props.onChange(this.props.pages.prev); | client/components/Paging.jsx | 7 |
| 11 | }, | client/components/Paging.jsx | 7 | |
| 12 | onNextPage: function onNextPage() { | client/components/Paging.jsx | 9 | |
| 13 | client/components/Paging.jsx | 9 | ||
| 14 | 6 | this.props.onChange(this.props.pages.next); | client/components/Paging.jsx | 11 |
| 15 | }, | client/components/Paging.jsx | 11 | |
| 16 | render: function render() { | client/components/Paging.jsx | 13 | |
| 17 | client/components/Paging.jsx | 13 | ||
| 18 | 68 | return React.createElement( | client/components/Paging.jsx | 15 |
| 19 | "div", | client/components/Paging.jsx | 16 | |
| 20 | { className: "well" }, | client/components/Paging.jsx | 16 | |
| 21 | React.createElement( | client/components/Paging.jsx | 16 | |
| 22 | "div", | client/components/Paging.jsx | 17 | |
| 23 | { className: "btn-group pull-left" }, | client/components/Paging.jsx | 17 | |
| 24 | React.createElement( | client/components/Paging.jsx | 17 | |
| 25 | "button", | client/components/Paging.jsx | 18 | |
| 26 | { | client/components/Paging.jsx | 18 | |
| 27 | className: "btn btn-default", | client/components/Paging.jsx | 19 | |
| 28 | disabled: true }, | client/components/Paging.jsx | 20 | |
| 29 | "Page ", | client/components/Paging.jsx | 20 | |
| 30 | this.props.pages.current, | client/components/Paging.jsx | 20 | |
| 31 | " of ", | client/components/Paging.jsx | 22 | |
| 32 | this.props.pages.total | client/components/Paging.jsx | 22 | |
| 33 | ), | client/components/Paging.jsx | 22 | |
| 34 | React.createElement( | client/components/Paging.jsx | 23 | |
| 35 | "button", | client/components/Paging.jsx | 24 | |
| 36 | { | client/components/Paging.jsx | 24 | |
| 37 | className: "btn btn-default", | client/components/Paging.jsx | 25 | |
| 38 | disabled: true }, | client/components/Paging.jsx | 26 | |
| 39 | "Rows ", | client/components/Paging.jsx | 26 | |
| 40 | this.props.items.begin, | client/components/Paging.jsx | 26 | |
| 41 | " - ", | client/components/Paging.jsx | 28 | |
| 42 | this.props.items.end, | client/components/Paging.jsx | 28 | |
| 43 | " of ", | client/components/Paging.jsx | 28 | |
| 44 | this.props.items.total | client/components/Paging.jsx | 28 | |
| 45 | ) | client/components/Paging.jsx | 28 | |
| 46 | ), | client/components/Paging.jsx | 29 | |
| 47 | React.createElement( | client/components/Paging.jsx | 30 | |
| 48 | "div", | client/components/Paging.jsx | 31 | |
| 49 | { className: "btn-group pull-right" }, | client/components/Paging.jsx | 31 | |
| 50 | React.createElement( | client/components/Paging.jsx | 31 | |
| 51 | "button", | client/components/Paging.jsx | 32 | |
| 52 | { | client/components/Paging.jsx | 32 | |
| 53 | ref: "prev", | client/components/Paging.jsx | 33 | |
| 54 | className: "btn btn-default", | client/components/Paging.jsx | 34 | |
| 55 | disabled: !this.props.pages.hasPrev, | client/components/Paging.jsx | 35 | |
| 56 | onClick: this.onPrevPage }, | client/components/Paging.jsx | 36 | |
| 57 | "Prev" | client/components/Paging.jsx | 36 | |
| 58 | ), | client/components/Paging.jsx | 36 | |
| 59 | React.createElement( | client/components/Paging.jsx | 39 | |
| 60 | "button", | client/components/Paging.jsx | 40 | |
| 61 | { | client/components/Paging.jsx | 40 | |
| 62 | ref: "next", | client/components/Paging.jsx | 41 | |
| 63 | className: "btn btn-default", | client/components/Paging.jsx | 42 | |
| 64 | disabled: !this.props.pages.hasNext, | client/components/Paging.jsx | 43 | |
| 65 | onClick: this.onNextPage }, | client/components/Paging.jsx | 44 | |
| 66 | "Next" | client/components/Paging.jsx | 44 | |
| 67 | ) | client/components/Paging.jsx | 44 | |
| 68 | ), | client/components/Paging.jsx | 47 | |
| 69 | React.createElement("div", { className: "clearfix" }) | client/components/Paging.jsx | 48 | |
| 70 | ); | client/components/Paging.jsx | 49 | |
| 71 | } | client/components/Paging.jsx | 51 | |
| 72 | }); | client/components/Paging.jsx | 52 | |
| 73 | client/components/Paging.jsx | 53 | ||
| 74 | 1 | module.exports = Component; | client/components/Paging.jsx | 56 |
| 75 | client/components/Paging.jsx | 56 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/components/form/Button.jsx | 1 | |
| 2 | client/components/form/Button.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/components/form/Button.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/components/form/Button.jsx | 2 |
| 5 | 1 | var ClassNames = require('classnames'); | client/components/form/Button.jsx | 3 |
| 6 | client/components/form/Button.jsx | 3 | ||
| 7 | 1 | var View = React.createClass({ | client/components/form/Button.jsx | 6 |
| 8 | displayName: 'View', | client/components/form/Button.jsx | 6 | |
| 9 | client/components/form/Button.jsx | 6 | ||
| 10 | getDefaultProps: function getDefaultProps() { | client/components/form/Button.jsx | 7 | |
| 11 | client/components/form/Button.jsx | 7 | ||
| 12 | 1 | return { | client/components/form/Button.jsx | 9 |
| 13 | type: 'button' | client/components/form/Button.jsx | 10 | |
| 14 | }; | client/components/form/Button.jsx | 10 | |
| 15 | }, | client/components/form/Button.jsx | 11 | |
| 16 | render: function render() { | client/components/form/Button.jsx | 13 | |
| 17 | client/components/form/Button.jsx | 13 | ||
| 18 | 493 | var inputClasses = ClassNames(ObjectAssign({ | client/components/form/Button.jsx | 15 |
| 19 | 'btn': true | client/components/form/Button.jsx | 16 | |
| 20 | }, this.props.inputClasses)); | client/components/form/Button.jsx | 16 | |
| 21 | client/components/form/Button.jsx | 17 | ||
| 22 | 493 | return React.createElement( | client/components/form/Button.jsx | 19 |
| 23 | 'button', | client/components/form/Button.jsx | 20 | |
| 24 | { | client/components/form/Button.jsx | 20 | |
| 25 | type: this.props.type, | client/components/form/Button.jsx | 21 | |
| 26 | className: inputClasses, | client/components/form/Button.jsx | 22 | |
| 27 | name: this.props.name, | client/components/form/Button.jsx | 23 | |
| 28 | value: this.props.value, | client/components/form/Button.jsx | 24 | |
| 29 | disabled: this.props.disabled ? 'disabled' : undefined, | client/components/form/Button.jsx | 25 | |
| 30 | onClick: this.props.onClick }, | client/components/form/Button.jsx | 26 | |
| 31 | this.props.children | client/components/form/Button.jsx | 26 | |
| 32 | ); | client/components/form/Button.jsx | 28 | |
| 33 | } | client/components/form/Button.jsx | 30 | |
| 34 | }); | client/components/form/Button.jsx | 31 | |
| 35 | client/components/form/Button.jsx | 32 | ||
| 36 | 1 | module.exports = View; | client/components/form/Button.jsx | 35 |
| 37 | client/components/form/Button.jsx | 35 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/components/form/ControlGroup.jsx | 1 | |
| 2 | client/components/form/ControlGroup.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/components/form/ControlGroup.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/components/form/ControlGroup.jsx | 2 |
| 5 | 1 | var ClassNames = require('classnames'); | client/components/form/ControlGroup.jsx | 3 |
| 6 | client/components/form/ControlGroup.jsx | 3 | ||
| 7 | 1 | var View = React.createClass({ | client/components/form/ControlGroup.jsx | 6 |
| 8 | displayName: 'View', | client/components/form/ControlGroup.jsx | 6 | |
| 9 | client/components/form/ControlGroup.jsx | 6 | ||
| 10 | render: function render() { | client/components/form/ControlGroup.jsx | 7 | |
| 11 | client/components/form/ControlGroup.jsx | 7 | ||
| 12 | 1806 | var groupClasses = ClassNames(ObjectAssign({ | client/components/form/ControlGroup.jsx | 9 |
| 13 | 'form-group': true, | client/components/form/ControlGroup.jsx | 10 | |
| 14 | 'has-error': this.props.hasError | client/components/form/ControlGroup.jsx | 11 | |
| 15 | }, this.props.groupClasses)); | client/components/form/ControlGroup.jsx | 11 | |
| 16 | client/components/form/ControlGroup.jsx | 12 | ||
| 17 | 1806 | var labelClasses = ClassNames(ObjectAssign({ | client/components/form/ControlGroup.jsx | 14 |
| 18 | 'control-label': true | client/components/form/ControlGroup.jsx | 15 | |
| 19 | }, this.props.labelClasses)); | client/components/form/ControlGroup.jsx | 15 | |
| 20 | client/components/form/ControlGroup.jsx | 16 | ||
| 21 | 1806 | var helpClasses = ClassNames(ObjectAssign({ | client/components/form/ControlGroup.jsx | 18 |
| 22 | 'help-block': true | client/components/form/ControlGroup.jsx | 19 | |
| 23 | }, this.props.helpClasses)); | client/components/form/ControlGroup.jsx | 19 | |
| 24 | client/components/form/ControlGroup.jsx | 20 | ||
| 25 | 1806 | var labelComponent; | client/components/form/ControlGroup.jsx | 22 |
| 26 | 1806 | if (!this.props.hideLabel) { | client/components/form/ControlGroup.jsx | 23 |
| 27 | 1295 | labelComponent = React.createElement( | client/components/form/ControlGroup.jsx | 24 |
| 28 | 'label', | client/components/form/ControlGroup.jsx | 24 | |
| 29 | { className: labelClasses }, | client/components/form/ControlGroup.jsx | 24 | |
| 30 | this.props.label | client/components/form/ControlGroup.jsx | 24 | |
| 31 | ); | client/components/form/ControlGroup.jsx | 25 | |
| 32 | } | client/components/form/ControlGroup.jsx | 26 | |
| 33 | client/components/form/ControlGroup.jsx | 27 | ||
| 34 | 1806 | var helpComponent; | client/components/form/ControlGroup.jsx | 29 |
| 35 | 1806 | if (!this.props.hideHelp) { | client/components/form/ControlGroup.jsx | 30 |
| 36 | 1158 | helpComponent = React.createElement( | client/components/form/ControlGroup.jsx | 31 |
| 37 | 'span', | client/components/form/ControlGroup.jsx | 31 | |
| 38 | { className: helpClasses }, | client/components/form/ControlGroup.jsx | 31 | |
| 39 | this.props.help | client/components/form/ControlGroup.jsx | 31 | |
| 40 | ); | client/components/form/ControlGroup.jsx | 32 | |
| 41 | } | client/components/form/ControlGroup.jsx | 33 | |
| 42 | client/components/form/ControlGroup.jsx | 34 | ||
| 43 | 1806 | return React.createElement( | client/components/form/ControlGroup.jsx | 36 |
| 44 | 'div', | client/components/form/ControlGroup.jsx | 37 | |
| 45 | { className: groupClasses }, | client/components/form/ControlGroup.jsx | 37 | |
| 46 | labelComponent, | client/components/form/ControlGroup.jsx | 37 | |
| 47 | this.props.children, | client/components/form/ControlGroup.jsx | 38 | |
| 48 | helpComponent | client/components/form/ControlGroup.jsx | 39 | |
| 49 | ); | client/components/form/ControlGroup.jsx | 40 | |
| 50 | } | client/components/form/ControlGroup.jsx | 42 | |
| 51 | }); | client/components/form/ControlGroup.jsx | 43 | |
| 52 | client/components/form/ControlGroup.jsx | 44 | ||
| 53 | 1 | module.exports = View; | client/components/form/ControlGroup.jsx | 47 |
| 54 | client/components/form/ControlGroup.jsx | 47 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/components/form/SelectControl.jsx | 1 | |
| 2 | client/components/form/SelectControl.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/components/form/SelectControl.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/components/form/SelectControl.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../components/form/ControlGroup'); | client/components/form/SelectControl.jsx | 3 |
| 6 | 1 | var ClassNames = require('classnames'); | client/components/form/SelectControl.jsx | 4 |
| 7 | client/components/form/SelectControl.jsx | 4 | ||
| 8 | 1 | var View = React.createClass({ | client/components/form/SelectControl.jsx | 7 |
| 9 | displayName: 'View', | client/components/form/SelectControl.jsx | 7 | |
| 10 | client/components/form/SelectControl.jsx | 7 | ||
| 11 | getDefaultProps: function getDefaultProps() { | client/components/form/SelectControl.jsx | 8 | |
| 12 | client/components/form/SelectControl.jsx | 8 | ||
| 13 | 1 | return { | client/components/form/SelectControl.jsx | 10 |
| 14 | type: 'text' | client/components/form/SelectControl.jsx | 11 | |
| 15 | }; | client/components/form/SelectControl.jsx | 11 | |
| 16 | }, | client/components/form/SelectControl.jsx | 12 | |
| 17 | render: function render() { | client/components/form/SelectControl.jsx | 14 | |
| 18 | client/components/form/SelectControl.jsx | 14 | ||
| 19 | 304 | var inputClasses = ClassNames(ObjectAssign({ | client/components/form/SelectControl.jsx | 16 |
| 20 | 'form-control': true | client/components/form/SelectControl.jsx | 17 | |
| 21 | }, this.props.inputClasses)); | client/components/form/SelectControl.jsx | 17 | |
| 22 | client/components/form/SelectControl.jsx | 18 | ||
| 23 | 304 | return React.createElement( | client/components/form/SelectControl.jsx | 20 |
| 24 | ControlGroup, | client/components/form/SelectControl.jsx | 21 | |
| 25 | { | client/components/form/SelectControl.jsx | 21 | |
| 26 | hasError: this.props.hasError, | client/components/form/SelectControl.jsx | 22 | |
| 27 | label: this.props.label, | client/components/form/SelectControl.jsx | 23 | |
| 28 | help: this.props.help }, | client/components/form/SelectControl.jsx | 24 | |
| 29 | React.createElement( | client/components/form/SelectControl.jsx | 24 | |
| 30 | 'select', | client/components/form/SelectControl.jsx | 26 | |
| 31 | { | client/components/form/SelectControl.jsx | 26 | |
| 32 | ref: 'selectField', | client/components/form/SelectControl.jsx | 27 | |
| 33 | multiple: this.props.multiple, | client/components/form/SelectControl.jsx | 28 | |
| 34 | className: inputClasses, | client/components/form/SelectControl.jsx | 29 | |
| 35 | name: this.props.name, | client/components/form/SelectControl.jsx | 30 | |
| 36 | size: this.props.size, | client/components/form/SelectControl.jsx | 31 | |
| 37 | value: this.props.value, | client/components/form/SelectControl.jsx | 32 | |
| 38 | valueLink: this.props.valueLink, | client/components/form/SelectControl.jsx | 33 | |
| 39 | defaultValue: this.props.defaultValue, | client/components/form/SelectControl.jsx | 34 | |
| 40 | disabled: this.props.disabled, | client/components/form/SelectControl.jsx | 35 | |
| 41 | onChange: this.props.onChange }, | client/components/form/SelectControl.jsx | 36 | |
| 42 | this.props.children | client/components/form/SelectControl.jsx | 36 | |
| 43 | ) | client/components/form/SelectControl.jsx | 38 | |
| 44 | ); | client/components/form/SelectControl.jsx | 39 | |
| 45 | } | client/components/form/SelectControl.jsx | 41 | |
| 46 | }); | client/components/form/SelectControl.jsx | 42 | |
| 47 | client/components/form/SelectControl.jsx | 43 | ||
| 48 | 1 | module.exports = View; | client/components/form/SelectControl.jsx | 46 |
| 49 | client/components/form/SelectControl.jsx | 46 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/components/form/Spinner.jsx | 1 | |
| 2 | client/components/form/Spinner.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/components/form/Spinner.jsx | 1 |
| 4 | 1 | var ClassNames = require('classnames'); | client/components/form/Spinner.jsx | 2 |
| 5 | client/components/form/Spinner.jsx | 2 | ||
| 6 | 1 | var View = React.createClass({ | client/components/form/Spinner.jsx | 5 |
| 7 | displayName: 'View', | client/components/form/Spinner.jsx | 5 | |
| 8 | client/components/form/Spinner.jsx | 5 | ||
| 9 | render: function render() { | client/components/form/Spinner.jsx | 6 | |
| 10 | client/components/form/Spinner.jsx | 6 | ||
| 11 | 513 | var spaceLeft; | client/components/form/Spinner.jsx | 8 |
| 12 | 513 | if (this.props.space === 'left') { | client/components/form/Spinner.jsx | 9 |
| 13 | 510 | spaceLeft = 'Â Â '; | client/components/form/Spinner.jsx | 10 |
| 14 | } | client/components/form/Spinner.jsx | 10 | |
| 15 | client/components/form/Spinner.jsx | 11 | ||
| 16 | 513 | var spaceRight; | client/components/form/Spinner.jsx | 13 |
| 17 | 513 | if (this.props.space === 'right') { | client/components/form/Spinner.jsx | 14 |
| 18 | 1 | spaceRight = 'Â Â '; | client/components/form/Spinner.jsx | 15 |
| 19 | } | client/components/form/Spinner.jsx | 15 | |
| 20 | client/components/form/Spinner.jsx | 16 | ||
| 21 | 513 | var spinnerClasses = ClassNames({ | client/components/form/Spinner.jsx | 18 |
| 22 | hidden: !this.props.show | client/components/form/Spinner.jsx | 19 | |
| 23 | }); | client/components/form/Spinner.jsx | 19 | |
| 24 | client/components/form/Spinner.jsx | 20 | ||
| 25 | 513 | return React.createElement( | client/components/form/Spinner.jsx | 22 |
| 26 | 'span', | client/components/form/Spinner.jsx | 23 | |
| 27 | { className: spinnerClasses }, | client/components/form/Spinner.jsx | 23 | |
| 28 | spaceLeft, | client/components/form/Spinner.jsx | 23 | |
| 29 | React.createElement('i', { className: 'fa fa-refresh fa-spin' }), | client/components/form/Spinner.jsx | 24 | |
| 30 | spaceRight | client/components/form/Spinner.jsx | 25 | |
| 31 | ); | client/components/form/Spinner.jsx | 26 | |
| 32 | } | client/components/form/Spinner.jsx | 28 | |
| 33 | }); | client/components/form/Spinner.jsx | 29 | |
| 34 | client/components/form/Spinner.jsx | 30 | ||
| 35 | 1 | module.exports = View; | client/components/form/Spinner.jsx | 33 |
| 36 | client/components/form/Spinner.jsx | 33 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/components/form/TextControl.jsx | 1 | |
| 2 | client/components/form/TextControl.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/components/form/TextControl.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/components/form/TextControl.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../components/form/ControlGroup'); | client/components/form/TextControl.jsx | 3 |
| 6 | 1 | var ClassNames = require('classnames'); | client/components/form/TextControl.jsx | 4 |
| 7 | client/components/form/TextControl.jsx | 4 | ||
| 8 | 1 | var View = React.createClass({ | client/components/form/TextControl.jsx | 7 |
| 9 | displayName: 'View', | client/components/form/TextControl.jsx | 7 | |
| 10 | client/components/form/TextControl.jsx | 7 | ||
| 11 | getDefaultProps: function getDefaultProps() { | client/components/form/TextControl.jsx | 8 | |
| 12 | client/components/form/TextControl.jsx | 8 | ||
| 13 | 1 | return { | client/components/form/TextControl.jsx | 10 |
| 14 | type: 'text', | client/components/form/TextControl.jsx | 11 | |
| 15 | autoCapitalize: 'off' | client/components/form/TextControl.jsx | 12 | |
| 16 | }; | client/components/form/TextControl.jsx | 12 | |
| 17 | }, | client/components/form/TextControl.jsx | 13 | |
| 18 | render: function render() { | client/components/form/TextControl.jsx | 15 | |
| 19 | client/components/form/TextControl.jsx | 15 | ||
| 20 | 808 | var inputClasses = ClassNames(ObjectAssign({ | client/components/form/TextControl.jsx | 17 |
| 21 | 'form-control': true | client/components/form/TextControl.jsx | 18 | |
| 22 | }, this.props.inputClasses)); | client/components/form/TextControl.jsx | 18 | |
| 23 | client/components/form/TextControl.jsx | 19 | ||
| 24 | 808 | return React.createElement( | client/components/form/TextControl.jsx | 21 |
| 25 | ControlGroup, | client/components/form/TextControl.jsx | 22 | |
| 26 | { | client/components/form/TextControl.jsx | 22 | |
| 27 | hasError: this.props.hasError, | client/components/form/TextControl.jsx | 23 | |
| 28 | label: this.props.label, | client/components/form/TextControl.jsx | 24 | |
| 29 | help: this.props.help }, | client/components/form/TextControl.jsx | 25 | |
| 30 | React.createElement('input', { | client/components/form/TextControl.jsx | 25 | |
| 31 | ref: 'inputField', | client/components/form/TextControl.jsx | 28 | |
| 32 | type: this.props.type, | client/components/form/TextControl.jsx | 29 | |
| 33 | autoCapitalize: this.props.autoCapitalize, | client/components/form/TextControl.jsx | 30 | |
| 34 | className: inputClasses, | client/components/form/TextControl.jsx | 31 | |
| 35 | name: this.props.name, | client/components/form/TextControl.jsx | 32 | |
| 36 | placeholder: this.props.placeholder, | client/components/form/TextControl.jsx | 33 | |
| 37 | value: this.props.value, | client/components/form/TextControl.jsx | 34 | |
| 38 | valueLink: this.props.valueLink, | client/components/form/TextControl.jsx | 35 | |
| 39 | disabled: this.props.disabled ? 'disabled' : undefined, | client/components/form/TextControl.jsx | 36 | |
| 40 | onChange: this.props.onChange | client/components/form/TextControl.jsx | 37 | |
| 41 | }) | client/components/form/TextControl.jsx | 37 | |
| 42 | ); | client/components/form/TextControl.jsx | 38 | |
| 43 | } | client/components/form/TextControl.jsx | 40 | |
| 44 | }); | client/components/form/TextControl.jsx | 41 | |
| 45 | client/components/form/TextControl.jsx | 42 | ||
| 46 | 1 | module.exports = View; | client/components/form/TextControl.jsx | 45 |
| 47 | client/components/form/TextControl.jsx | 45 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/components/form/TextareaControl.jsx | 1 | |
| 2 | client/components/form/TextareaControl.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/components/form/TextareaControl.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/components/form/TextareaControl.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../components/form/ControlGroup'); | client/components/form/TextareaControl.jsx | 3 |
| 6 | 1 | var ClassNames = require('classnames'); | client/components/form/TextareaControl.jsx | 4 |
| 7 | client/components/form/TextareaControl.jsx | 4 | ||
| 8 | 1 | var View = React.createClass({ | client/components/form/TextareaControl.jsx | 7 |
| 9 | displayName: 'View', | client/components/form/TextareaControl.jsx | 7 | |
| 10 | client/components/form/TextareaControl.jsx | 7 | ||
| 11 | render: function render() { | client/components/form/TextareaControl.jsx | 8 | |
| 12 | client/components/form/TextareaControl.jsx | 8 | ||
| 13 | 22 | var inputClasses = ClassNames(ObjectAssign({ | client/components/form/TextareaControl.jsx | 10 |
| 14 | 'form-control': true | client/components/form/TextareaControl.jsx | 11 | |
| 15 | }, this.props.inputClasses)); | client/components/form/TextareaControl.jsx | 11 | |
| 16 | client/components/form/TextareaControl.jsx | 12 | ||
| 17 | 22 | return React.createElement( | client/components/form/TextareaControl.jsx | 14 |
| 18 | ControlGroup, | client/components/form/TextareaControl.jsx | 15 | |
| 19 | { | client/components/form/TextareaControl.jsx | 15 | |
| 20 | hasError: this.props.hasError, | client/components/form/TextareaControl.jsx | 16 | |
| 21 | label: this.props.label, | client/components/form/TextareaControl.jsx | 17 | |
| 22 | help: this.props.help }, | client/components/form/TextareaControl.jsx | 18 | |
| 23 | React.createElement('textarea', { | client/components/form/TextareaControl.jsx | 18 | |
| 24 | ref: 'inputField', | client/components/form/TextareaControl.jsx | 21 | |
| 25 | className: inputClasses, | client/components/form/TextareaControl.jsx | 22 | |
| 26 | name: this.props.name, | client/components/form/TextareaControl.jsx | 23 | |
| 27 | rows: this.props.rows, | client/components/form/TextareaControl.jsx | 24 | |
| 28 | placeholder: this.props.placeholder, | client/components/form/TextareaControl.jsx | 25 | |
| 29 | value: this.props.value, | client/components/form/TextareaControl.jsx | 26 | |
| 30 | valueLink: this.props.valueLink, | client/components/form/TextareaControl.jsx | 27 | |
| 31 | disabled: this.props.disabled ? 'disabled' : undefined, | client/components/form/TextareaControl.jsx | 28 | |
| 32 | onChange: this.props.onChange | client/components/form/TextareaControl.jsx | 29 | |
| 33 | }) | client/components/form/TextareaControl.jsx | 29 | |
| 34 | ); | client/components/form/TextareaControl.jsx | 30 | |
| 35 | } | client/components/form/TextareaControl.jsx | 32 | |
| 36 | }); | client/components/form/TextareaControl.jsx | 33 | |
| 37 | client/components/form/TextareaControl.jsx | 34 | ||
| 38 | 1 | module.exports = View; | client/components/form/TextareaControl.jsx | 37 |
| 39 | client/components/form/TextareaControl.jsx | 37 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | ||
| 3 | ||
| 4 | 1 | module.exports = FluxConstant.set([ |
| 5 | 'SERVER_ACTION', | |
| 6 | 'VIEW_ACTION' | |
| 7 | ]); | |
| 8 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('./PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'SAVE_RETURN_URL', | |
| 9 | 'SAVE_RETURN_URL_RESPONSE', | |
| 10 | 'CLEAR_RETURN_URL', | |
| 11 | 'CLEAR_RETURN_URL_RESPONSE' | |
| 12 | ]) | |
| 13 | }; | |
| 14 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window, document */ | |
| 2 | 1 | var Xhr = require('xhr'); |
| 3 | 1 | var Qs = require('qs'); |
| 4 | 1 | var Cookie = require('cookie'); |
| 5 | 1 | var RedirectActions = require('../actions/Redirect'); |
| 6 | ||
| 7 | ||
| 8 | 1 | module.exports = function jsonFetch (options, callback) { |
| 9 | ||
| 10 | 8 | var cookies = Cookie.parse(document.cookie); |
| 11 | 8 | var config = { |
| 12 | url: options.url, | |
| 13 | method: options.method, | |
| 14 | headers: { | |
| 15 | 'Accept': 'application/json', | |
| 16 | 'Content-Type': 'application/json' | |
| 17 | } | |
| 18 | }; | |
| 19 | ||
| 20 | 8 | if (cookies.crumb) { |
| 21 | 7 | config.headers['X-CSRF-Token'] = cookies.crumb; |
| 22 | } | |
| 23 | ||
| 24 | 8 | if (options.query) { |
| 25 | 1 | config.url += '?' + Qs.stringify(options.query); |
| 26 | } | |
| 27 | ||
| 28 | 8 | if (options.data) { |
| 29 | 1 | config.body = JSON.stringify(options.data); |
| 30 | } | |
| 31 | ||
| 32 | 8 | Xhr(config, function (err, response, body) { |
| 33 | ||
| 34 | 8 | if (err) { |
| 35 | 1 | callback(err); |
| 36 | } | |
| 37 | 7 | else if (response.statusCode >= 200 && response.statusCode < 300) { |
| 38 | 5 | if (response.headers.hasOwnProperty('x-auth-required')) { |
| 39 | 1 | RedirectActions.saveReturnUrl(); |
| 40 | 1 | window.location.href = '/login'; |
| 41 | } | |
| 42 | else { | |
| 43 | 4 | callback(null, JSON.parse(body)); |
| 44 | } | |
| 45 | } | |
| 46 | else { | |
| 47 | 2 | var httpErr = new Error(response.rawRequest.statusText); |
| 48 | 2 | callback(httpErr, JSON.parse(body)); |
| 49 | } | |
| 50 | }); | |
| 51 | }; | |
| 52 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | module.exports = function parseValidation (validation, message) { |
| 2 | ||
| 3 | 113 | var response = { |
| 4 | error: undefined, | |
| 5 | hasError: {}, | |
| 6 | help: {} | |
| 7 | }; | |
| 8 | ||
| 9 | 113 | if (validation && validation.keys) { |
| 10 | 16 | var forField = validation.keys.pop(); |
| 11 | 16 | var regexBecause = /because \[(.*?)\]/; |
| 12 | ||
| 13 | 16 | if (regexBecause.test(message)) { |
| 14 | 1 | message = regexBecause.exec(message)[1]; |
| 15 | } | |
| 16 | ||
| 17 | 16 | response.hasError[forField] = true; |
| 18 | 16 | response.help[forField] = message; |
| 19 | } | |
| 20 | 97 | else if (message) { |
| 21 | 21 | response.error = message; |
| 22 | } | |
| 23 | ||
| 24 | 113 | return response; |
| 25 | }; | |
| 26 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var Constants = require('./Constants'); |
| 3 | 1 | var Fetch = require('../../helpers/jsonFetch'); |
| 4 | ||
| 5 | ||
| 6 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 7 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 8 | 1 | var Types = Constants.ActionTypes; |
| 9 | 1 | var dispatch = Dispatcher.handleAction; |
| 10 | ||
| 11 | ||
| 12 | 1 | var Actions = { |
| 13 | getAccountSettings: function (data) { | |
| 14 | ||
| 15 | 2 | dispatch(VIEW_ACTION, Types.GET_ACCOUNT_SETTINGS, data); |
| 16 | ||
| 17 | 2 | var request = { |
| 18 | method: 'GET', | |
| 19 | url: '/api/accounts/my', | |
| 20 | data: data, | |
| 21 | useAuth: true | |
| 22 | }; | |
| 23 | ||
| 24 | 2 | Fetch(request, function (err, response) { |
| 25 | ||
| 26 | 2 | dispatch(SERVER_ACTION, Types.GET_ACCOUNT_SETTINGS_RESPONSE, response); |
| 27 | }); | |
| 28 | }, | |
| 29 | saveAccountSettings: function (data) { | |
| 30 | ||
| 31 | 2 | dispatch(VIEW_ACTION, Types.SAVE_ACCOUNT_SETTINGS, data); |
| 32 | ||
| 33 | 2 | var request = { |
| 34 | method: 'PUT', | |
| 35 | url: '/api/accounts/my', | |
| 36 | data: data, | |
| 37 | useAuth: true | |
| 38 | }; | |
| 39 | ||
| 40 | 2 | Fetch(request, function (err, response) { |
| 41 | ||
| 42 | 2 | if (!err) { |
| 43 | 1 | response.success = true; |
| 44 | } | |
| 45 | ||
| 46 | 2 | dispatch(SERVER_ACTION, Types.SAVE_ACCOUNT_SETTINGS_RESPONSE, response); |
| 47 | }); | |
| 48 | }, | |
| 49 | getUserSettings: function (data) { | |
| 50 | ||
| 51 | 2 | dispatch(VIEW_ACTION, Types.GET_USER_SETTINGS, data); |
| 52 | ||
| 53 | 2 | var request = { |
| 54 | method: 'GET', | |
| 55 | url: '/api/users/my', | |
| 56 | data: data, | |
| 57 | useAuth: true | |
| 58 | }; | |
| 59 | ||
| 60 | 2 | Fetch(request, function (err, response) { |
| 61 | ||
| 62 | 2 | dispatch(SERVER_ACTION, Types.GET_USER_SETTINGS_RESPONSE, response); |
| 63 | }); | |
| 64 | }, | |
| 65 | saveUserSettings: function (data) { | |
| 66 | ||
| 67 | 2 | dispatch(VIEW_ACTION, Types.SAVE_USER_SETTINGS, data); |
| 68 | ||
| 69 | 2 | var request = { |
| 70 | method: 'PUT', | |
| 71 | url: '/api/users/my', | |
| 72 | data: data, | |
| 73 | useAuth: true | |
| 74 | }; | |
| 75 | ||
| 76 | 2 | Fetch(request, function (err, response) { |
| 77 | ||
| 78 | 2 | if (!err) { |
| 79 | 1 | response.success = true; |
| 80 | } | |
| 81 | ||
| 82 | 2 | dispatch(SERVER_ACTION, Types.SAVE_USER_SETTINGS_RESPONSE, response); |
| 83 | }); | |
| 84 | }, | |
| 85 | savePasswordSettings: function (data) { | |
| 86 | ||
| 87 | 3 | dispatch(VIEW_ACTION, Types.SAVE_PASSWORD_SETTINGS, data); |
| 88 | ||
| 89 | 3 | if (data.password !== data.passwordConfirm) { |
| 90 | 1 | dispatch(VIEW_ACTION, Types.SAVE_PASSWORD_SETTINGS_RESPONSE, { |
| 91 | message: 'Passwords do not match.' | |
| 92 | }); | |
| 93 | ||
| 94 | 1 | return; |
| 95 | } | |
| 96 | ||
| 97 | 2 | delete data.passwordConfirm; |
| 98 | ||
| 99 | 2 | var request = { |
| 100 | method: 'PUT', | |
| 101 | url: '/api/users/my/password', | |
| 102 | data: data, | |
| 103 | useAuth: true | |
| 104 | }; | |
| 105 | ||
| 106 | 2 | Fetch(request, function (err, response) { |
| 107 | ||
| 108 | 2 | if (!err) { |
| 109 | 1 | response.success = true; |
| 110 | } | |
| 111 | ||
| 112 | 2 | dispatch(SERVER_ACTION, Types.SAVE_PASSWORD_SETTINGS_RESPONSE, response); |
| 113 | }); | |
| 114 | } | |
| 115 | }; | |
| 116 | ||
| 117 | ||
| 118 | 1 | module.exports = Actions; |
| 119 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'GET_ACCOUNT_SETTINGS', | |
| 9 | 'GET_ACCOUNT_SETTINGS_RESPONSE', | |
| 10 | 'SAVE_ACCOUNT_SETTINGS', | |
| 11 | 'SAVE_ACCOUNT_SETTINGS_RESPONSE', | |
| 12 | 'GET_USER_SETTINGS', | |
| 13 | 'GET_USER_SETTINGS_RESPONSE', | |
| 14 | 'SAVE_USER_SETTINGS', | |
| 15 | 'SAVE_USER_SETTINGS_RESPONSE', | |
| 16 | 'SAVE_PASSWORD_SETTINGS', | |
| 17 | 'SAVE_PASSWORD_SETTINGS_RESPONSE' | |
| 18 | ]) | |
| 19 | }; | |
| 20 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/Routes.jsx | 1 | |
| 2 | client/pages/account/Routes.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/Routes.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/account/Routes.jsx | 2 |
| 5 | 1 | var App = require('./components/App'); | client/pages/account/Routes.jsx | 3 |
| 6 | 1 | var Home = require('./components/home/Controller'); | client/pages/account/Routes.jsx | 4 |
| 7 | 1 | var NotFound = require('./components/not-found/Controller'); | client/pages/account/Routes.jsx | 5 |
| 8 | 1 | var Settings = require('./components/settings/Controller'); | client/pages/account/Routes.jsx | 6 |
| 9 | client/pages/account/Routes.jsx | 6 | ||
| 10 | 1 | var Route = ReactRouter.Route; | client/pages/account/Routes.jsx | 9 |
| 11 | 1 | var DefaultRoute = ReactRouter.DefaultRoute; | client/pages/account/Routes.jsx | 10 |
| 12 | 1 | var NotFoundRoute = ReactRouter.NotFoundRoute; | client/pages/account/Routes.jsx | 11 |
| 13 | client/pages/account/Routes.jsx | 11 | ||
| 14 | 1 | var routes = React.createElement( | client/pages/account/Routes.jsx | 14 |
| 15 | Route, | client/pages/account/Routes.jsx | 15 | |
| 16 | { path: '/account', name: 'app', handler: App }, | client/pages/account/Routes.jsx | 15 | |
| 17 | React.createElement(DefaultRoute, { name: 'home', handler: Home }), | client/pages/account/Routes.jsx | 15 | |
| 18 | React.createElement(NotFoundRoute, { name: 'notFound', handler: NotFound }), | client/pages/account/Routes.jsx | 16 | |
| 19 | React.createElement(Route, { path: 'settings', name: 'settings', handler: Settings }) | client/pages/account/Routes.jsx | 17 | |
| 20 | ); | client/pages/account/Routes.jsx | 19 | |
| 21 | client/pages/account/Routes.jsx | 21 | ||
| 22 | 1 | module.exports = routes; | client/pages/account/Routes.jsx | 24 |
| 23 | client/pages/account/Routes.jsx | 24 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/account/index.jsx | 1 | |
| 2 | 'use strict'; | client/pages/account/index.jsx | 2 | |
| 3 | client/pages/account/index.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/account/index.jsx | 2 |
| 5 | 1 | var ReactRouter = require('react-router'); | client/pages/account/index.jsx | 3 |
| 6 | 1 | var Routes = require('./Routes'); | client/pages/account/index.jsx | 4 |
| 7 | client/pages/account/index.jsx | 4 | ||
| 8 | 1 | var HistoryLocation = ReactRouter.HistoryLocation; | client/pages/account/index.jsx | 7 |
| 9 | client/pages/account/index.jsx | 7 | ||
| 10 | 1 | var App = { | client/pages/account/index.jsx | 10 |
| 11 | blastoff: function blastoff() { | client/pages/account/index.jsx | 11 | |
| 12 | client/pages/account/index.jsx | 11 | ||
| 13 | 1 | var self = this; | client/pages/account/index.jsx | 13 |
| 14 | client/pages/account/index.jsx | 13 | ||
| 15 | 1 | ReactRouter.run(Routes, HistoryLocation, function (Handler) { | client/pages/account/index.jsx | 15 |
| 16 | client/pages/account/index.jsx | 15 | ||
| 17 | 1 | self.mainElement = React.render(React.createElement(Handler, null), window.document.getElementById('app-mount')); | client/pages/account/index.jsx | 17 |
| 18 | }); | client/pages/account/index.jsx | 20 | |
| 19 | } | client/pages/account/index.jsx | 21 | |
| 20 | }; | client/pages/account/index.jsx | 22 | |
| 21 | client/pages/account/index.jsx | 23 | ||
| 22 | 1 | module.exports = App; | client/pages/account/index.jsx | 26 |
| 23 | client/pages/account/index.jsx | 26 | ||
| 24 | /* $lab:coverage:off$ */ | client/pages/account/index.jsx | 26 | |
| 25 | if (!module.parent) { | client/pages/account/index.jsx | 30 | |
| 26 | window.app = App; | client/pages/account/index.jsx | 31 | |
| 27 | App.blastoff(); | client/pages/account/index.jsx | 32 | |
| 28 | } | client/pages/account/index.jsx | 32 | |
| 29 | /* $lab:coverage:on$ */ | client/pages/account/index.jsx | 33 | |
| 30 | client/pages/account/index.jsx | 33 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/App.jsx | 1 | |
| 2 | client/pages/account/components/App.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/App.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/account/components/App.jsx | 2 |
| 5 | 1 | var NavBar = require('./NavBar'); | client/pages/account/components/App.jsx | 3 |
| 6 | 1 | var Footer = require('./Footer'); | client/pages/account/components/App.jsx | 4 |
| 7 | client/pages/account/components/App.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/account/components/App.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/account/components/App.jsx | 7 | |
| 10 | client/pages/account/components/App.jsx | 7 | ||
| 11 | render: function render() { | client/pages/account/components/App.jsx | 8 | |
| 12 | client/pages/account/components/App.jsx | 8 | ||
| 13 | 2 | return React.createElement( | client/pages/account/components/App.jsx | 10 |
| 14 | 'div', | client/pages/account/components/App.jsx | 11 | |
| 15 | null, | client/pages/account/components/App.jsx | 11 | |
| 16 | React.createElement(NavBar, null), | client/pages/account/components/App.jsx | 11 | |
| 17 | React.createElement(ReactRouter.RouteHandler, null), | client/pages/account/components/App.jsx | 12 | |
| 18 | React.createElement(Footer, null) | client/pages/account/components/App.jsx | 13 | |
| 19 | ); | client/pages/account/components/App.jsx | 14 | |
| 20 | } | client/pages/account/components/App.jsx | 16 | |
| 21 | }); | client/pages/account/components/App.jsx | 17 | |
| 22 | client/pages/account/components/App.jsx | 18 | ||
| 23 | 1 | module.exports = Component; | client/pages/account/components/App.jsx | 21 |
| 24 | client/pages/account/components/App.jsx | 21 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | "use strict"; | client/pages/account/components/Footer.jsx | 1 | |
| 2 | client/pages/account/components/Footer.jsx | 2 | ||
| 3 | 1 | var React = require("react/addons"); | client/pages/account/components/Footer.jsx | 1 |
| 4 | client/pages/account/components/Footer.jsx | 1 | ||
| 5 | 1 | var Component = React.createClass({ | client/pages/account/components/Footer.jsx | 4 |
| 6 | displayName: "Component", | client/pages/account/components/Footer.jsx | 4 | |
| 7 | client/pages/account/components/Footer.jsx | 4 | ||
| 8 | render: function render() { | client/pages/account/components/Footer.jsx | 5 | |
| 9 | client/pages/account/components/Footer.jsx | 5 | ||
| 10 | 3 | return React.createElement( | client/pages/account/components/Footer.jsx | 7 |
| 11 | "div", | client/pages/account/components/Footer.jsx | 8 | |
| 12 | { className: "footer" }, | client/pages/account/components/Footer.jsx | 8 | |
| 13 | React.createElement( | client/pages/account/components/Footer.jsx | 8 | |
| 14 | "div", | client/pages/account/components/Footer.jsx | 9 | |
| 15 | { className: "container" }, | client/pages/account/components/Footer.jsx | 9 | |
| 16 | React.createElement( | client/pages/account/components/Footer.jsx | 9 | |
| 17 | "span", | client/pages/account/components/Footer.jsx | 10 | |
| 18 | { className: "copyright pull-right" }, | client/pages/account/components/Footer.jsx | 10 | |
| 19 | "© 2014 Acme, Inc." | client/pages/account/components/Footer.jsx | 10 | |
| 20 | ), | client/pages/account/components/Footer.jsx | 10 | |
| 21 | React.createElement( | client/pages/account/components/Footer.jsx | 12 | |
| 22 | "ul", | client/pages/account/components/Footer.jsx | 13 | |
| 23 | { className: "links" }, | client/pages/account/components/Footer.jsx | 13 | |
| 24 | React.createElement( | client/pages/account/components/Footer.jsx | 13 | |
| 25 | "li", | client/pages/account/components/Footer.jsx | 14 | |
| 26 | null, | client/pages/account/components/Footer.jsx | 14 | |
| 27 | React.createElement( | client/pages/account/components/Footer.jsx | 14 | |
| 28 | "a", | client/pages/account/components/Footer.jsx | 14 | |
| 29 | { href: "/" }, | client/pages/account/components/Footer.jsx | 14 | |
| 30 | "Home" | client/pages/account/components/Footer.jsx | 14 | |
| 31 | ) | client/pages/account/components/Footer.jsx | 14 | |
| 32 | ), | client/pages/account/components/Footer.jsx | 14 | |
| 33 | React.createElement( | client/pages/account/components/Footer.jsx | 14 | |
| 34 | "li", | client/pages/account/components/Footer.jsx | 15 | |
| 35 | null, | client/pages/account/components/Footer.jsx | 15 | |
| 36 | React.createElement( | client/pages/account/components/Footer.jsx | 15 | |
| 37 | "a", | client/pages/account/components/Footer.jsx | 15 | |
| 38 | { href: "/login/logout" }, | client/pages/account/components/Footer.jsx | 15 | |
| 39 | "Sign out" | client/pages/account/components/Footer.jsx | 15 | |
| 40 | ) | client/pages/account/components/Footer.jsx | 15 | |
| 41 | ) | client/pages/account/components/Footer.jsx | 15 | |
| 42 | ) | client/pages/account/components/Footer.jsx | 15 | |
| 43 | ) | client/pages/account/components/Footer.jsx | 16 | |
| 44 | ); | client/pages/account/components/Footer.jsx | 17 | |
| 45 | } | client/pages/account/components/Footer.jsx | 19 | |
| 46 | }); | client/pages/account/components/Footer.jsx | 20 | |
| 47 | client/pages/account/components/Footer.jsx | 21 | ||
| 48 | 1 | module.exports = Component; | client/pages/account/components/Footer.jsx | 24 |
| 49 | client/pages/account/components/Footer.jsx | 24 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/NavBar.jsx | 1 | |
| 2 | client/pages/account/components/NavBar.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/NavBar.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/account/components/NavBar.jsx | 2 |
| 5 | 1 | var ClassNames = require('classnames'); | client/pages/account/components/NavBar.jsx | 3 |
| 6 | client/pages/account/components/NavBar.jsx | 3 | ||
| 7 | 1 | var Link = ReactRouter.Link; | client/pages/account/components/NavBar.jsx | 6 |
| 8 | client/pages/account/components/NavBar.jsx | 6 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/account/components/NavBar.jsx | 9 |
| 10 | displayName: 'Component', | client/pages/account/components/NavBar.jsx | 9 | |
| 11 | client/pages/account/components/NavBar.jsx | 9 | ||
| 12 | contextTypes: { | client/pages/account/components/NavBar.jsx | 10 | |
| 13 | router: React.PropTypes.func | client/pages/account/components/NavBar.jsx | 11 | |
| 14 | }, | client/pages/account/components/NavBar.jsx | 11 | |
| 15 | getInitialState: function getInitialState() { | client/pages/account/components/NavBar.jsx | 13 | |
| 16 | client/pages/account/components/NavBar.jsx | 13 | ||
| 17 | 5 | return { | client/pages/account/components/NavBar.jsx | 15 |
| 18 | navBarOpen: false | client/pages/account/components/NavBar.jsx | 16 | |
| 19 | }; | client/pages/account/components/NavBar.jsx | 16 | |
| 20 | }, | client/pages/account/components/NavBar.jsx | 17 | |
| 21 | componentWillReceiveProps: function componentWillReceiveProps() { | client/pages/account/components/NavBar.jsx | 19 | |
| 22 | client/pages/account/components/NavBar.jsx | 19 | ||
| 23 | 1 | this.setState({ navBarOpen: false }); | client/pages/account/components/NavBar.jsx | 21 |
| 24 | }, | client/pages/account/components/NavBar.jsx | 21 | |
| 25 | isNavActive: function isNavActive(routes) { | client/pages/account/components/NavBar.jsx | 23 | |
| 26 | client/pages/account/components/NavBar.jsx | 23 | ||
| 27 | 14 | return ClassNames({ | client/pages/account/components/NavBar.jsx | 25 |
| 28 | active: routes.some((function (route) { | client/pages/account/components/NavBar.jsx | 26 | |
| 29 | client/pages/account/components/NavBar.jsx | 26 | ||
| 30 | 14 | return this.context.router.isActive(route); | client/pages/account/components/NavBar.jsx | 28 |
| 31 | }).bind(this)) | client/pages/account/components/NavBar.jsx | 28 | |
| 32 | }); | client/pages/account/components/NavBar.jsx | 29 | |
| 33 | }, | client/pages/account/components/NavBar.jsx | 30 | |
| 34 | toggleMenu: function toggleMenu() { | client/pages/account/components/NavBar.jsx | 32 | |
| 35 | client/pages/account/components/NavBar.jsx | 32 | ||
| 36 | 1 | this.setState({ navBarOpen: !this.state.navBarOpen }); | client/pages/account/components/NavBar.jsx | 34 |
| 37 | }, | client/pages/account/components/NavBar.jsx | 34 | |
| 38 | render: function render() { | client/pages/account/components/NavBar.jsx | 36 | |
| 39 | client/pages/account/components/NavBar.jsx | 36 | ||
| 40 | 7 | var navBarCollapse = ClassNames({ | client/pages/account/components/NavBar.jsx | 38 |
| 41 | 'navbar-collapse': true, | client/pages/account/components/NavBar.jsx | 39 | |
| 42 | collapse: !this.state.navBarOpen | client/pages/account/components/NavBar.jsx | 40 | |
| 43 | }); | client/pages/account/components/NavBar.jsx | 40 | |
| 44 | client/pages/account/components/NavBar.jsx | 41 | ||
| 45 | 7 | return React.createElement( | client/pages/account/components/NavBar.jsx | 43 |
| 46 | 'div', | client/pages/account/components/NavBar.jsx | 44 | |
| 47 | { className: 'navbar navbar-default navbar-fixed-top' }, | client/pages/account/components/NavBar.jsx | 44 | |
| 48 | React.createElement( | client/pages/account/components/NavBar.jsx | 44 | |
| 49 | 'div', | client/pages/account/components/NavBar.jsx | 45 | |
| 50 | { className: 'container' }, | client/pages/account/components/NavBar.jsx | 45 | |
| 51 | React.createElement( | client/pages/account/components/NavBar.jsx | 45 | |
| 52 | 'div', | client/pages/account/components/NavBar.jsx | 46 | |
| 53 | { className: 'navbar-header' }, | client/pages/account/components/NavBar.jsx | 46 | |
| 54 | React.createElement( | client/pages/account/components/NavBar.jsx | 46 | |
| 55 | Link, | client/pages/account/components/NavBar.jsx | 47 | |
| 56 | { className: 'navbar-brand', to: 'home' }, | client/pages/account/components/NavBar.jsx | 47 | |
| 57 | React.createElement('img', { className: 'navbar-logo', src: '/public/media/logo-square.png' }), | client/pages/account/components/NavBar.jsx | 47 | |
| 58 | React.createElement( | client/pages/account/components/NavBar.jsx | 48 | |
| 59 | 'span', | client/pages/account/components/NavBar.jsx | 49 | |
| 60 | { className: 'navbar-brand-label' }, | client/pages/account/components/NavBar.jsx | 49 | |
| 61 | 'Aqua' | client/pages/account/components/NavBar.jsx | 49 | |
| 62 | ) | client/pages/account/components/NavBar.jsx | 49 | |
| 63 | ), | client/pages/account/components/NavBar.jsx | 49 | |
| 64 | React.createElement( | client/pages/account/components/NavBar.jsx | 50 | |
| 65 | 'button', | client/pages/account/components/NavBar.jsx | 51 | |
| 66 | { | client/pages/account/components/NavBar.jsx | 51 | |
| 67 | className: 'navbar-toggle collapsed', | client/pages/account/components/NavBar.jsx | 52 | |
| 68 | onClick: this.toggleMenu }, | client/pages/account/components/NavBar.jsx | 53 | |
| 69 | React.createElement('span', { className: 'icon-bar' }), | client/pages/account/components/NavBar.jsx | 53 | |
| 70 | React.createElement('span', { className: 'icon-bar' }), | client/pages/account/components/NavBar.jsx | 55 | |
| 71 | React.createElement('span', { className: 'icon-bar' }) | client/pages/account/components/NavBar.jsx | 56 | |
| 72 | ) | client/pages/account/components/NavBar.jsx | 57 | |
| 73 | ), | client/pages/account/components/NavBar.jsx | 58 | |
| 74 | React.createElement( | client/pages/account/components/NavBar.jsx | 59 | |
| 75 | 'div', | client/pages/account/components/NavBar.jsx | 60 | |
| 76 | { className: navBarCollapse }, | client/pages/account/components/NavBar.jsx | 60 | |
| 77 | React.createElement( | client/pages/account/components/NavBar.jsx | 60 | |
| 78 | 'ul', | client/pages/account/components/NavBar.jsx | 61 | |
| 79 | { className: 'nav navbar-nav' }, | client/pages/account/components/NavBar.jsx | 61 | |
| 80 | React.createElement( | client/pages/account/components/NavBar.jsx | 61 | |
| 81 | 'li', | client/pages/account/components/NavBar.jsx | 62 | |
| 82 | { className: this.isNavActive(['home']) }, | client/pages/account/components/NavBar.jsx | 62 | |
| 83 | React.createElement( | client/pages/account/components/NavBar.jsx | 62 | |
| 84 | Link, | client/pages/account/components/NavBar.jsx | 63 | |
| 85 | { to: 'home' }, | client/pages/account/components/NavBar.jsx | 63 | |
| 86 | 'My account' | client/pages/account/components/NavBar.jsx | 63 | |
| 87 | ) | client/pages/account/components/NavBar.jsx | 63 | |
| 88 | ), | client/pages/account/components/NavBar.jsx | 63 | |
| 89 | React.createElement( | client/pages/account/components/NavBar.jsx | 64 | |
| 90 | 'li', | client/pages/account/components/NavBar.jsx | 65 | |
| 91 | { className: this.isNavActive(['settings']) }, | client/pages/account/components/NavBar.jsx | 65 | |
| 92 | React.createElement( | client/pages/account/components/NavBar.jsx | 65 | |
| 93 | Link, | client/pages/account/components/NavBar.jsx | 66 | |
| 94 | { to: 'settings' }, | client/pages/account/components/NavBar.jsx | 66 | |
| 95 | 'Settings' | client/pages/account/components/NavBar.jsx | 66 | |
| 96 | ) | client/pages/account/components/NavBar.jsx | 66 | |
| 97 | ) | client/pages/account/components/NavBar.jsx | 66 | |
| 98 | ), | client/pages/account/components/NavBar.jsx | 67 | |
| 99 | React.createElement( | client/pages/account/components/NavBar.jsx | 68 | |
| 100 | 'ul', | client/pages/account/components/NavBar.jsx | 69 | |
| 101 | { className: 'nav navbar-nav navbar-right' }, | client/pages/account/components/NavBar.jsx | 69 | |
| 102 | React.createElement( | client/pages/account/components/NavBar.jsx | 69 | |
| 103 | 'li', | client/pages/account/components/NavBar.jsx | 70 | |
| 104 | null, | client/pages/account/components/NavBar.jsx | 70 | |
| 105 | React.createElement( | client/pages/account/components/NavBar.jsx | 70 | |
| 106 | 'a', | client/pages/account/components/NavBar.jsx | 71 | |
| 107 | { href: '/login/logout' }, | client/pages/account/components/NavBar.jsx | 71 | |
| 108 | 'Sign out' | client/pages/account/components/NavBar.jsx | 71 | |
| 109 | ) | client/pages/account/components/NavBar.jsx | 71 | |
| 110 | ) | client/pages/account/components/NavBar.jsx | 71 | |
| 111 | ) | client/pages/account/components/NavBar.jsx | 72 | |
| 112 | ) | client/pages/account/components/NavBar.jsx | 73 | |
| 113 | ) | client/pages/account/components/NavBar.jsx | 74 | |
| 114 | ); | client/pages/account/components/NavBar.jsx | 75 | |
| 115 | } | client/pages/account/components/NavBar.jsx | 77 | |
| 116 | }); | client/pages/account/components/NavBar.jsx | 78 | |
| 117 | client/pages/account/components/NavBar.jsx | 79 | ||
| 118 | 1 | module.exports = Component; | client/pages/account/components/NavBar.jsx | 82 |
| 119 | client/pages/account/components/NavBar.jsx | 82 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/home/Controller.jsx | 1 | |
| 2 | client/pages/account/components/home/Controller.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/home/Controller.jsx | 1 |
| 4 | 1 | var Moment = require('moment'); | client/pages/account/components/home/Controller.jsx | 2 |
| 5 | client/pages/account/components/home/Controller.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | client/pages/account/components/home/Controller.jsx | 5 |
| 7 | displayName: 'Component', | client/pages/account/components/home/Controller.jsx | 5 | |
| 8 | client/pages/account/components/home/Controller.jsx | 5 | ||
| 9 | getInitialState: function getInitialState() { | client/pages/account/components/home/Controller.jsx | 6 | |
| 10 | client/pages/account/components/home/Controller.jsx | 6 | ||
| 11 | 3 | return this.getThisMoment(); | client/pages/account/components/home/Controller.jsx | 8 |
| 12 | }, | client/pages/account/components/home/Controller.jsx | 8 | |
| 13 | componentDidMount: function componentDidMount() { | client/pages/account/components/home/Controller.jsx | 10 | |
| 14 | client/pages/account/components/home/Controller.jsx | 10 | ||
| 15 | 3 | this.interval = setInterval(this.refreshTime, 1000); | client/pages/account/components/home/Controller.jsx | 12 |
| 16 | }, | client/pages/account/components/home/Controller.jsx | 12 | |
| 17 | componentWillUnmount: function componentWillUnmount() { | client/pages/account/components/home/Controller.jsx | 14 | |
| 18 | client/pages/account/components/home/Controller.jsx | 14 | ||
| 19 | 3 | clearInterval(this.interval); | client/pages/account/components/home/Controller.jsx | 16 |
| 20 | }, | client/pages/account/components/home/Controller.jsx | 16 | |
| 21 | refreshTime: function refreshTime() { | client/pages/account/components/home/Controller.jsx | 18 | |
| 22 | client/pages/account/components/home/Controller.jsx | 18 | ||
| 23 | 1 | this.setState(this.getThisMoment()); | client/pages/account/components/home/Controller.jsx | 20 |
| 24 | }, | client/pages/account/components/home/Controller.jsx | 20 | |
| 25 | getThisMoment: function getThisMoment() { | client/pages/account/components/home/Controller.jsx | 22 | |
| 26 | client/pages/account/components/home/Controller.jsx | 22 | ||
| 27 | 4 | var thisMoment = Moment(); | client/pages/account/components/home/Controller.jsx | 24 |
| 28 | client/pages/account/components/home/Controller.jsx | 24 | ||
| 29 | 4 | return { | client/pages/account/components/home/Controller.jsx | 26 |
| 30 | second: thisMoment.format('ss'), | client/pages/account/components/home/Controller.jsx | 27 | |
| 31 | minute: thisMoment.format('mm'), | client/pages/account/components/home/Controller.jsx | 28 | |
| 32 | hour: thisMoment.format('HH'), | client/pages/account/components/home/Controller.jsx | 29 | |
| 33 | day: thisMoment.format('DD'), | client/pages/account/components/home/Controller.jsx | 30 | |
| 34 | month: thisMoment.format('MM'), | client/pages/account/components/home/Controller.jsx | 31 | |
| 35 | year: thisMoment.format('YYYY') | client/pages/account/components/home/Controller.jsx | 32 | |
| 36 | }; | client/pages/account/components/home/Controller.jsx | 32 | |
| 37 | }, | client/pages/account/components/home/Controller.jsx | 33 | |
| 38 | render: function render() { | client/pages/account/components/home/Controller.jsx | 35 | |
| 39 | client/pages/account/components/home/Controller.jsx | 35 | ||
| 40 | 4 | return React.createElement( | client/pages/account/components/home/Controller.jsx | 37 |
| 41 | 'section', | client/pages/account/components/home/Controller.jsx | 38 | |
| 42 | { className: 'section-home container' }, | client/pages/account/components/home/Controller.jsx | 38 | |
| 43 | React.createElement( | client/pages/account/components/home/Controller.jsx | 38 | |
| 44 | 'div', | client/pages/account/components/home/Controller.jsx | 39 | |
| 45 | { className: 'row' }, | client/pages/account/components/home/Controller.jsx | 39 | |
| 46 | React.createElement( | client/pages/account/components/home/Controller.jsx | 39 | |
| 47 | 'div', | client/pages/account/components/home/Controller.jsx | 40 | |
| 48 | { className: 'col-sm-7' }, | client/pages/account/components/home/Controller.jsx | 40 | |
| 49 | React.createElement( | client/pages/account/components/home/Controller.jsx | 40 | |
| 50 | 'h1', | client/pages/account/components/home/Controller.jsx | 41 | |
| 51 | { className: 'page-header' }, | client/pages/account/components/home/Controller.jsx | 41 | |
| 52 | 'My account' | client/pages/account/components/home/Controller.jsx | 41 | |
| 53 | ), | client/pages/account/components/home/Controller.jsx | 41 | |
| 54 | React.createElement( | client/pages/account/components/home/Controller.jsx | 41 | |
| 55 | 'div', | client/pages/account/components/home/Controller.jsx | 42 | |
| 56 | { className: 'row' }, | client/pages/account/components/home/Controller.jsx | 42 | |
| 57 | React.createElement( | client/pages/account/components/home/Controller.jsx | 42 | |
| 58 | 'div', | client/pages/account/components/home/Controller.jsx | 43 | |
| 59 | { className: 'col-sm-4' }, | client/pages/account/components/home/Controller.jsx | 43 | |
| 60 | React.createElement( | client/pages/account/components/home/Controller.jsx | 43 | |
| 61 | 'div', | client/pages/account/components/home/Controller.jsx | 44 | |
| 62 | { className: 'well text-center' }, | client/pages/account/components/home/Controller.jsx | 44 | |
| 63 | React.createElement( | client/pages/account/components/home/Controller.jsx | 44 | |
| 64 | 'div', | client/pages/account/components/home/Controller.jsx | 45 | |
| 65 | { className: 'stat-value' }, | client/pages/account/components/home/Controller.jsx | 45 | |
| 66 | this.state.hour | client/pages/account/components/home/Controller.jsx | 45 | |
| 67 | ), | client/pages/account/components/home/Controller.jsx | 46 | |
| 68 | React.createElement( | client/pages/account/components/home/Controller.jsx | 47 | |
| 69 | 'div', | client/pages/account/components/home/Controller.jsx | 48 | |
| 70 | { className: 'stat-label' }, | client/pages/account/components/home/Controller.jsx | 48 | |
| 71 | 'hour' | client/pages/account/components/home/Controller.jsx | 48 | |
| 72 | ) | client/pages/account/components/home/Controller.jsx | 48 | |
| 73 | ) | client/pages/account/components/home/Controller.jsx | 48 | |
| 74 | ), | client/pages/account/components/home/Controller.jsx | 49 | |
| 75 | React.createElement( | client/pages/account/components/home/Controller.jsx | 50 | |
| 76 | 'div', | client/pages/account/components/home/Controller.jsx | 51 | |
| 77 | { className: 'col-sm-4' }, | client/pages/account/components/home/Controller.jsx | 51 | |
| 78 | React.createElement( | client/pages/account/components/home/Controller.jsx | 51 | |
| 79 | 'div', | client/pages/account/components/home/Controller.jsx | 52 | |
| 80 | { className: 'well text-center' }, | client/pages/account/components/home/Controller.jsx | 52 | |
| 81 | React.createElement( | client/pages/account/components/home/Controller.jsx | 52 | |
| 82 | 'div', | client/pages/account/components/home/Controller.jsx | 53 | |
| 83 | { className: 'stat-value' }, | client/pages/account/components/home/Controller.jsx | 53 | |
| 84 | this.state.minute | client/pages/account/components/home/Controller.jsx | 53 | |
| 85 | ), | client/pages/account/components/home/Controller.jsx | 54 | |
| 86 | React.createElement( | client/pages/account/components/home/Controller.jsx | 55 | |
| 87 | 'div', | client/pages/account/components/home/Controller.jsx | 56 | |
| 88 | { className: 'stat-label' }, | client/pages/account/components/home/Controller.jsx | 56 | |
| 89 | 'minute' | client/pages/account/components/home/Controller.jsx | 56 | |
| 90 | ) | client/pages/account/components/home/Controller.jsx | 56 | |
| 91 | ) | client/pages/account/components/home/Controller.jsx | 56 | |
| 92 | ), | client/pages/account/components/home/Controller.jsx | 57 | |
| 93 | React.createElement( | client/pages/account/components/home/Controller.jsx | 58 | |
| 94 | 'div', | client/pages/account/components/home/Controller.jsx | 59 | |
| 95 | { className: 'col-sm-4' }, | client/pages/account/components/home/Controller.jsx | 59 | |
| 96 | React.createElement( | client/pages/account/components/home/Controller.jsx | 59 | |
| 97 | 'div', | client/pages/account/components/home/Controller.jsx | 60 | |
| 98 | { className: 'well text-center' }, | client/pages/account/components/home/Controller.jsx | 60 | |
| 99 | React.createElement( | client/pages/account/components/home/Controller.jsx | 60 | |
| 100 | 'div', | client/pages/account/components/home/Controller.jsx | 61 | |
| 101 | { className: 'stat-value' }, | client/pages/account/components/home/Controller.jsx | 61 | |
| 102 | this.state.second | client/pages/account/components/home/Controller.jsx | 61 | |
| 103 | ), | client/pages/account/components/home/Controller.jsx | 62 | |
| 104 | React.createElement( | client/pages/account/components/home/Controller.jsx | 63 | |
| 105 | 'div', | client/pages/account/components/home/Controller.jsx | 64 | |
| 106 | { className: 'stat-label' }, | client/pages/account/components/home/Controller.jsx | 64 | |
| 107 | 'second' | client/pages/account/components/home/Controller.jsx | 64 | |
| 108 | ) | client/pages/account/components/home/Controller.jsx | 64 | |
| 109 | ) | client/pages/account/components/home/Controller.jsx | 64 | |
| 110 | ), | client/pages/account/components/home/Controller.jsx | 65 | |
| 111 | React.createElement( | client/pages/account/components/home/Controller.jsx | 66 | |
| 112 | 'div', | client/pages/account/components/home/Controller.jsx | 67 | |
| 113 | { className: 'col-sm-4' }, | client/pages/account/components/home/Controller.jsx | 67 | |
| 114 | React.createElement( | client/pages/account/components/home/Controller.jsx | 67 | |
| 115 | 'div', | client/pages/account/components/home/Controller.jsx | 68 | |
| 116 | { className: 'well text-center' }, | client/pages/account/components/home/Controller.jsx | 68 | |
| 117 | React.createElement( | client/pages/account/components/home/Controller.jsx | 68 | |
| 118 | 'div', | client/pages/account/components/home/Controller.jsx | 69 | |
| 119 | { className: 'stat-value' }, | client/pages/account/components/home/Controller.jsx | 69 | |
| 120 | this.state.year | client/pages/account/components/home/Controller.jsx | 69 | |
| 121 | ), | client/pages/account/components/home/Controller.jsx | 70 | |
| 122 | React.createElement( | client/pages/account/components/home/Controller.jsx | 71 | |
| 123 | 'div', | client/pages/account/components/home/Controller.jsx | 72 | |
| 124 | { className: 'stat-label' }, | client/pages/account/components/home/Controller.jsx | 72 | |
| 125 | 'year' | client/pages/account/components/home/Controller.jsx | 72 | |
| 126 | ) | client/pages/account/components/home/Controller.jsx | 72 | |
| 127 | ) | client/pages/account/components/home/Controller.jsx | 72 | |
| 128 | ), | client/pages/account/components/home/Controller.jsx | 73 | |
| 129 | React.createElement( | client/pages/account/components/home/Controller.jsx | 74 | |
| 130 | 'div', | client/pages/account/components/home/Controller.jsx | 75 | |
| 131 | { className: 'col-sm-4' }, | client/pages/account/components/home/Controller.jsx | 75 | |
| 132 | React.createElement( | client/pages/account/components/home/Controller.jsx | 75 | |
| 133 | 'div', | client/pages/account/components/home/Controller.jsx | 76 | |
| 134 | { className: 'well text-center' }, | client/pages/account/components/home/Controller.jsx | 76 | |
| 135 | React.createElement( | client/pages/account/components/home/Controller.jsx | 76 | |
| 136 | 'div', | client/pages/account/components/home/Controller.jsx | 77 | |
| 137 | { className: 'stat-value' }, | client/pages/account/components/home/Controller.jsx | 77 | |
| 138 | this.state.month | client/pages/account/components/home/Controller.jsx | 77 | |
| 139 | ), | client/pages/account/components/home/Controller.jsx | 78 | |
| 140 | React.createElement( | client/pages/account/components/home/Controller.jsx | 79 | |
| 141 | 'div', | client/pages/account/components/home/Controller.jsx | 80 | |
| 142 | { className: 'stat-label' }, | client/pages/account/components/home/Controller.jsx | 80 | |
| 143 | 'month' | client/pages/account/components/home/Controller.jsx | 80 | |
| 144 | ) | client/pages/account/components/home/Controller.jsx | 80 | |
| 145 | ) | client/pages/account/components/home/Controller.jsx | 80 | |
| 146 | ), | client/pages/account/components/home/Controller.jsx | 81 | |
| 147 | React.createElement( | client/pages/account/components/home/Controller.jsx | 82 | |
| 148 | 'div', | client/pages/account/components/home/Controller.jsx | 83 | |
| 149 | { className: 'col-sm-4' }, | client/pages/account/components/home/Controller.jsx | 83 | |
| 150 | React.createElement( | client/pages/account/components/home/Controller.jsx | 83 | |
| 151 | 'div', | client/pages/account/components/home/Controller.jsx | 84 | |
| 152 | { className: 'well text-center' }, | client/pages/account/components/home/Controller.jsx | 84 | |
| 153 | React.createElement( | client/pages/account/components/home/Controller.jsx | 84 | |
| 154 | 'div', | client/pages/account/components/home/Controller.jsx | 85 | |
| 155 | { className: 'stat-value' }, | client/pages/account/components/home/Controller.jsx | 85 | |
| 156 | this.state.day | client/pages/account/components/home/Controller.jsx | 85 | |
| 157 | ), | client/pages/account/components/home/Controller.jsx | 86 | |
| 158 | React.createElement( | client/pages/account/components/home/Controller.jsx | 87 | |
| 159 | 'div', | client/pages/account/components/home/Controller.jsx | 88 | |
| 160 | { className: 'stat-label' }, | client/pages/account/components/home/Controller.jsx | 88 | |
| 161 | 'day' | client/pages/account/components/home/Controller.jsx | 88 | |
| 162 | ) | client/pages/account/components/home/Controller.jsx | 88 | |
| 163 | ) | client/pages/account/components/home/Controller.jsx | 88 | |
| 164 | ) | client/pages/account/components/home/Controller.jsx | 89 | |
| 165 | ) | client/pages/account/components/home/Controller.jsx | 90 | |
| 166 | ), | client/pages/account/components/home/Controller.jsx | 91 | |
| 167 | React.createElement( | client/pages/account/components/home/Controller.jsx | 92 | |
| 168 | 'div', | client/pages/account/components/home/Controller.jsx | 93 | |
| 169 | { className: 'col-sm-5' }, | client/pages/account/components/home/Controller.jsx | 93 | |
| 170 | React.createElement( | client/pages/account/components/home/Controller.jsx | 93 | |
| 171 | 'h1', | client/pages/account/components/home/Controller.jsx | 94 | |
| 172 | { className: 'page-header' }, | client/pages/account/components/home/Controller.jsx | 94 | |
| 173 | 'Throttle guage' | client/pages/account/components/home/Controller.jsx | 94 | |
| 174 | ), | client/pages/account/components/home/Controller.jsx | 94 | |
| 175 | React.createElement( | client/pages/account/components/home/Controller.jsx | 94 | |
| 176 | 'div', | client/pages/account/components/home/Controller.jsx | 95 | |
| 177 | { className: 'text-center' }, | client/pages/account/components/home/Controller.jsx | 95 | |
| 178 | React.createElement('i', { className: 'fa fa-dashboard bamf' }) | client/pages/account/components/home/Controller.jsx | 95 | |
| 179 | ) | client/pages/account/components/home/Controller.jsx | 96 | |
| 180 | ) | client/pages/account/components/home/Controller.jsx | 97 | |
| 181 | ) | client/pages/account/components/home/Controller.jsx | 98 | |
| 182 | ); | client/pages/account/components/home/Controller.jsx | 99 | |
| 183 | } | client/pages/account/components/home/Controller.jsx | 101 | |
| 184 | }); | client/pages/account/components/home/Controller.jsx | 102 | |
| 185 | client/pages/account/components/home/Controller.jsx | 103 | ||
| 186 | 1 | module.exports = Component; | client/pages/account/components/home/Controller.jsx | 106 |
| 187 | client/pages/account/components/home/Controller.jsx | 106 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/not-found/Controller.jsx | 1 | |
| 2 | client/pages/account/components/not-found/Controller.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/not-found/Controller.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/account/components/not-found/Controller.jsx | 2 |
| 5 | client/pages/account/components/not-found/Controller.jsx | 2 | ||
| 6 | 1 | var Link = ReactRouter.Link; | client/pages/account/components/not-found/Controller.jsx | 5 |
| 7 | client/pages/account/components/not-found/Controller.jsx | 5 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/account/components/not-found/Controller.jsx | 8 |
| 9 | displayName: 'Component', | client/pages/account/components/not-found/Controller.jsx | 8 | |
| 10 | client/pages/account/components/not-found/Controller.jsx | 8 | ||
| 11 | render: function render() { | client/pages/account/components/not-found/Controller.jsx | 9 | |
| 12 | client/pages/account/components/not-found/Controller.jsx | 9 | ||
| 13 | 2 | return React.createElement( | client/pages/account/components/not-found/Controller.jsx | 11 |
| 14 | 'section', | client/pages/account/components/not-found/Controller.jsx | 12 | |
| 15 | { className: 'section-not-found container' }, | client/pages/account/components/not-found/Controller.jsx | 12 | |
| 16 | React.createElement( | client/pages/account/components/not-found/Controller.jsx | 12 | |
| 17 | 'h1', | client/pages/account/components/not-found/Controller.jsx | 13 | |
| 18 | { className: 'page-header' }, | client/pages/account/components/not-found/Controller.jsx | 13 | |
| 19 | 'Not Found' | client/pages/account/components/not-found/Controller.jsx | 13 | |
| 20 | ), | client/pages/account/components/not-found/Controller.jsx | 13 | |
| 21 | React.createElement( | client/pages/account/components/not-found/Controller.jsx | 13 | |
| 22 | 'p', | client/pages/account/components/not-found/Controller.jsx | 14 | |
| 23 | null, | client/pages/account/components/not-found/Controller.jsx | 14 | |
| 24 | 'That route didn\'t match any handlers.' | client/pages/account/components/not-found/Controller.jsx | 14 | |
| 25 | ), | client/pages/account/components/not-found/Controller.jsx | 14 | |
| 26 | React.createElement( | client/pages/account/components/not-found/Controller.jsx | 14 | |
| 27 | Link, | client/pages/account/components/not-found/Controller.jsx | 15 | |
| 28 | { to: 'home' }, | client/pages/account/components/not-found/Controller.jsx | 15 | |
| 29 | 'Go to home screen' | client/pages/account/components/not-found/Controller.jsx | 15 | |
| 30 | ) | client/pages/account/components/not-found/Controller.jsx | 15 | |
| 31 | ); | client/pages/account/components/not-found/Controller.jsx | 15 | |
| 32 | } | client/pages/account/components/not-found/Controller.jsx | 17 | |
| 33 | }); | client/pages/account/components/not-found/Controller.jsx | 18 | |
| 34 | client/pages/account/components/not-found/Controller.jsx | 19 | ||
| 35 | 1 | module.exports = Component; | client/pages/account/components/not-found/Controller.jsx | 22 |
| 36 | client/pages/account/components/not-found/Controller.jsx | 22 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/settings/AccountForm.jsx | 1 | |
| 2 | client/pages/account/components/settings/AccountForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/settings/AccountForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/account/components/settings/AccountForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/account/components/settings/AccountForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/account/components/settings/AccountForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/account/components/settings/AccountForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../Actions'); | client/pages/account/components/settings/AccountForm.jsx | 6 |
| 9 | client/pages/account/components/settings/AccountForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/account/components/settings/AccountForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/account/components/settings/AccountForm.jsx | 9 | |
| 12 | client/pages/account/components/settings/AccountForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/account/components/settings/AccountForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/account/components/settings/AccountForm.jsx | 11 | |
| 15 | client/pages/account/components/settings/AccountForm.jsx | 11 | ||
| 16 | 10 | return { | client/pages/account/components/settings/AccountForm.jsx | 13 |
| 17 | hydrated: false, | client/pages/account/components/settings/AccountForm.jsx | 14 | |
| 18 | name: {} | client/pages/account/components/settings/AccountForm.jsx | 15 | |
| 19 | }; | client/pages/account/components/settings/AccountForm.jsx | 15 | |
| 20 | }, | client/pages/account/components/settings/AccountForm.jsx | 16 | |
| 21 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/account/components/settings/AccountForm.jsx | 18 | |
| 22 | client/pages/account/components/settings/AccountForm.jsx | 18 | ||
| 23 | 32 | if (!this.state.hydrated) { | client/pages/account/components/settings/AccountForm.jsx | 20 |
| 24 | 31 | this.setState({ | client/pages/account/components/settings/AccountForm.jsx | 21 |
| 25 | hydrated: nextProps.data.hydrated, | client/pages/account/components/settings/AccountForm.jsx | 22 | |
| 26 | nameFirst: nextProps.data.name.first, | client/pages/account/components/settings/AccountForm.jsx | 23 | |
| 27 | nameMiddle: nextProps.data.name.middle, | client/pages/account/components/settings/AccountForm.jsx | 24 | |
| 28 | nameLast: nextProps.data.name.last | client/pages/account/components/settings/AccountForm.jsx | 25 | |
| 29 | }); | client/pages/account/components/settings/AccountForm.jsx | 25 | |
| 30 | } | client/pages/account/components/settings/AccountForm.jsx | 26 | |
| 31 | }, | client/pages/account/components/settings/AccountForm.jsx | 27 | |
| 32 | handleSubmit: function handleSubmit(event) { | client/pages/account/components/settings/AccountForm.jsx | 29 | |
| 33 | client/pages/account/components/settings/AccountForm.jsx | 29 | ||
| 34 | 1 | event.preventDefault(); | client/pages/account/components/settings/AccountForm.jsx | 31 |
| 35 | 1 | event.stopPropagation(); | client/pages/account/components/settings/AccountForm.jsx | 32 |
| 36 | client/pages/account/components/settings/AccountForm.jsx | 32 | ||
| 37 | 1 | Actions.saveAccountSettings({ | client/pages/account/components/settings/AccountForm.jsx | 34 |
| 38 | nameFirst: this.state.nameFirst, | client/pages/account/components/settings/AccountForm.jsx | 35 | |
| 39 | nameMiddle: this.state.nameMiddle, | client/pages/account/components/settings/AccountForm.jsx | 36 | |
| 40 | nameLast: this.state.nameLast | client/pages/account/components/settings/AccountForm.jsx | 37 | |
| 41 | }); | client/pages/account/components/settings/AccountForm.jsx | 37 | |
| 42 | }, | client/pages/account/components/settings/AccountForm.jsx | 38 | |
| 43 | render: function render() { | client/pages/account/components/settings/AccountForm.jsx | 40 | |
| 44 | client/pages/account/components/settings/AccountForm.jsx | 40 | ||
| 45 | 42 | var alerts = []; | client/pages/account/components/settings/AccountForm.jsx | 42 |
| 46 | 42 | if (this.props.data.success) { | client/pages/account/components/settings/AccountForm.jsx | 43 |
| 47 | 1 | alerts.push(React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 44 |
| 48 | 'div', | client/pages/account/components/settings/AccountForm.jsx | 44 | |
| 49 | { key: 'success', className: 'alert alert-success' }, | client/pages/account/components/settings/AccountForm.jsx | 44 | |
| 50 | 'Success. Contact info settings saved.' | client/pages/account/components/settings/AccountForm.jsx | 44 | |
| 51 | )); | client/pages/account/components/settings/AccountForm.jsx | 44 | |
| 52 | 41 | } else if (this.props.data.error) { | client/pages/account/components/settings/AccountForm.jsx | 46 |
| 53 | 1 | alerts.push(React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 49 |
| 54 | 'div', | client/pages/account/components/settings/AccountForm.jsx | 49 | |
| 55 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/account/components/settings/AccountForm.jsx | 49 | |
| 56 | this.props.data.error | client/pages/account/components/settings/AccountForm.jsx | 49 | |
| 57 | )); | client/pages/account/components/settings/AccountForm.jsx | 50 | |
| 58 | } | client/pages/account/components/settings/AccountForm.jsx | 51 | |
| 59 | client/pages/account/components/settings/AccountForm.jsx | 52 | ||
| 60 | 42 | var notice; | client/pages/account/components/settings/AccountForm.jsx | 54 |
| 61 | 42 | if (!this.props.data.hydrated) { | client/pages/account/components/settings/AccountForm.jsx | 55 |
| 62 | 34 | notice = React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 56 |
| 63 | 'div', | client/pages/account/components/settings/AccountForm.jsx | 56 | |
| 64 | { className: 'alert alert-info' }, | client/pages/account/components/settings/AccountForm.jsx | 56 | |
| 65 | 'Loading contact info data...' | client/pages/account/components/settings/AccountForm.jsx | 56 | |
| 66 | ); | client/pages/account/components/settings/AccountForm.jsx | 56 | |
| 67 | } | client/pages/account/components/settings/AccountForm.jsx | 58 | |
| 68 | client/pages/account/components/settings/AccountForm.jsx | 59 | ||
| 69 | 42 | var formElements; | client/pages/account/components/settings/AccountForm.jsx | 61 |
| 70 | 42 | if (this.props.data.hydrated) { | client/pages/account/components/settings/AccountForm.jsx | 62 |
| 71 | 8 | formElements = React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 63 |
| 72 | 'fieldset', | client/pages/account/components/settings/AccountForm.jsx | 64 | |
| 73 | null, | client/pages/account/components/settings/AccountForm.jsx | 64 | |
| 74 | React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 64 | |
| 75 | 'legend', | client/pages/account/components/settings/AccountForm.jsx | 65 | |
| 76 | null, | client/pages/account/components/settings/AccountForm.jsx | 65 | |
| 77 | 'Contact info' | client/pages/account/components/settings/AccountForm.jsx | 65 | |
| 78 | ), | client/pages/account/components/settings/AccountForm.jsx | 65 | |
| 79 | alerts, | client/pages/account/components/settings/AccountForm.jsx | 65 | |
| 80 | React.createElement(TextControl, { | client/pages/account/components/settings/AccountForm.jsx | 66 | |
| 81 | name: 'nameFirst', | client/pages/account/components/settings/AccountForm.jsx | 68 | |
| 82 | label: 'First name', | client/pages/account/components/settings/AccountForm.jsx | 69 | |
| 83 | hasError: this.props.data.hasError.nameFirst, | client/pages/account/components/settings/AccountForm.jsx | 70 | |
| 84 | valueLink: this.linkState('nameFirst'), | client/pages/account/components/settings/AccountForm.jsx | 71 | |
| 85 | help: this.props.data.help.nameFirst, | client/pages/account/components/settings/AccountForm.jsx | 72 | |
| 86 | disabled: this.props.data.loading | client/pages/account/components/settings/AccountForm.jsx | 73 | |
| 87 | }), | client/pages/account/components/settings/AccountForm.jsx | 73 | |
| 88 | React.createElement(TextControl, { | client/pages/account/components/settings/AccountForm.jsx | 74 | |
| 89 | name: 'nameMiddle', | client/pages/account/components/settings/AccountForm.jsx | 76 | |
| 90 | label: 'Middle name', | client/pages/account/components/settings/AccountForm.jsx | 77 | |
| 91 | hasError: this.props.data.hasError.nameMiddle, | client/pages/account/components/settings/AccountForm.jsx | 78 | |
| 92 | valueLink: this.linkState('nameMiddle'), | client/pages/account/components/settings/AccountForm.jsx | 79 | |
| 93 | help: this.props.data.help.nameMiddle, | client/pages/account/components/settings/AccountForm.jsx | 80 | |
| 94 | disabled: this.props.data.loading | client/pages/account/components/settings/AccountForm.jsx | 81 | |
| 95 | }), | client/pages/account/components/settings/AccountForm.jsx | 81 | |
| 96 | React.createElement(TextControl, { | client/pages/account/components/settings/AccountForm.jsx | 82 | |
| 97 | name: 'nameLast', | client/pages/account/components/settings/AccountForm.jsx | 84 | |
| 98 | label: 'Last name', | client/pages/account/components/settings/AccountForm.jsx | 85 | |
| 99 | hasError: this.props.data.hasError.nameLast, | client/pages/account/components/settings/AccountForm.jsx | 86 | |
| 100 | valueLink: this.linkState('nameLast'), | client/pages/account/components/settings/AccountForm.jsx | 87 | |
| 101 | help: this.props.data.help.nameLast, | client/pages/account/components/settings/AccountForm.jsx | 88 | |
| 102 | disabled: this.props.data.loading | client/pages/account/components/settings/AccountForm.jsx | 89 | |
| 103 | }), | client/pages/account/components/settings/AccountForm.jsx | 89 | |
| 104 | React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 90 | |
| 105 | ControlGroup, | client/pages/account/components/settings/AccountForm.jsx | 91 | |
| 106 | { hideLabel: true, hideHelp: true }, | client/pages/account/components/settings/AccountForm.jsx | 91 | |
| 107 | React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 91 | |
| 108 | Button, | client/pages/account/components/settings/AccountForm.jsx | 92 | |
| 109 | { | client/pages/account/components/settings/AccountForm.jsx | 92 | |
| 110 | type: 'submit', | client/pages/account/components/settings/AccountForm.jsx | 93 | |
| 111 | inputClasses: { 'btn-primary': true }, | client/pages/account/components/settings/AccountForm.jsx | 94 | |
| 112 | disabled: this.props.data.loading }, | client/pages/account/components/settings/AccountForm.jsx | 95 | |
| 113 | 'Update contact info', | client/pages/account/components/settings/AccountForm.jsx | 95 | |
| 114 | React.createElement(Spinner, { | client/pages/account/components/settings/AccountForm.jsx | 95 | |
| 115 | space: 'left', | client/pages/account/components/settings/AccountForm.jsx | 99 | |
| 116 | show: this.props.data.loading | client/pages/account/components/settings/AccountForm.jsx | 100 | |
| 117 | }) | client/pages/account/components/settings/AccountForm.jsx | 100 | |
| 118 | ) | client/pages/account/components/settings/AccountForm.jsx | 101 | |
| 119 | ) | client/pages/account/components/settings/AccountForm.jsx | 102 | |
| 120 | ); | client/pages/account/components/settings/AccountForm.jsx | 103 | |
| 121 | } | client/pages/account/components/settings/AccountForm.jsx | 105 | |
| 122 | client/pages/account/components/settings/AccountForm.jsx | 106 | ||
| 123 | 42 | return React.createElement( | client/pages/account/components/settings/AccountForm.jsx | 108 |
| 124 | 'form', | client/pages/account/components/settings/AccountForm.jsx | 109 | |
| 125 | { onSubmit: this.handleSubmit }, | client/pages/account/components/settings/AccountForm.jsx | 109 | |
| 126 | notice, | client/pages/account/components/settings/AccountForm.jsx | 109 | |
| 127 | formElements | client/pages/account/components/settings/AccountForm.jsx | 110 | |
| 128 | ); | client/pages/account/components/settings/AccountForm.jsx | 111 | |
| 129 | } | client/pages/account/components/settings/AccountForm.jsx | 113 | |
| 130 | }); | client/pages/account/components/settings/AccountForm.jsx | 114 | |
| 131 | client/pages/account/components/settings/AccountForm.jsx | 115 | ||
| 132 | 1 | module.exports = Component; | client/pages/account/components/settings/AccountForm.jsx | 118 |
| 133 | client/pages/account/components/settings/AccountForm.jsx | 118 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/settings/Controller.jsx | 1 | |
| 2 | client/pages/account/components/settings/Controller.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/settings/Controller.jsx | 1 |
| 4 | 1 | var Actions = require('../../Actions'); | client/pages/account/components/settings/Controller.jsx | 2 |
| 5 | 1 | var AccountStore = require('../../stores/Account'); | client/pages/account/components/settings/Controller.jsx | 3 |
| 6 | 1 | var PasswordStore = require('../../stores/Password'); | client/pages/account/components/settings/Controller.jsx | 4 |
| 7 | 1 | var UserStore = require('../../stores/User'); | client/pages/account/components/settings/Controller.jsx | 5 |
| 8 | 1 | var AccountForm = require('./AccountForm'); | client/pages/account/components/settings/Controller.jsx | 6 |
| 9 | 1 | var UserForm = require('./UserForm'); | client/pages/account/components/settings/Controller.jsx | 7 |
| 10 | 1 | var PasswordForm = require('./PasswordForm'); | client/pages/account/components/settings/Controller.jsx | 8 |
| 11 | client/pages/account/components/settings/Controller.jsx | 8 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/account/components/settings/Controller.jsx | 11 |
| 13 | displayName: 'Component', | client/pages/account/components/settings/Controller.jsx | 11 | |
| 14 | client/pages/account/components/settings/Controller.jsx | 11 | ||
| 15 | getInitialState: function getInitialState() { | client/pages/account/components/settings/Controller.jsx | 12 | |
| 16 | client/pages/account/components/settings/Controller.jsx | 12 | ||
| 17 | 3 | AccountStore.reset(); | client/pages/account/components/settings/Controller.jsx | 14 |
| 18 | 3 | PasswordStore.reset(); | client/pages/account/components/settings/Controller.jsx | 15 |
| 19 | 3 | UserStore.reset(); | client/pages/account/components/settings/Controller.jsx | 16 |
| 20 | client/pages/account/components/settings/Controller.jsx | 16 | ||
| 21 | 3 | Actions.getAccountSettings(); | client/pages/account/components/settings/Controller.jsx | 18 |
| 22 | 3 | Actions.getUserSettings(); | client/pages/account/components/settings/Controller.jsx | 19 |
| 23 | client/pages/account/components/settings/Controller.jsx | 19 | ||
| 24 | 3 | return this.getStateFromStores(); | client/pages/account/components/settings/Controller.jsx | 21 |
| 25 | }, | client/pages/account/components/settings/Controller.jsx | 21 | |
| 26 | getStateFromStores: function getStateFromStores() { | client/pages/account/components/settings/Controller.jsx | 23 | |
| 27 | client/pages/account/components/settings/Controller.jsx | 23 | ||
| 28 | 33 | return { | client/pages/account/components/settings/Controller.jsx | 25 |
| 29 | account: AccountStore.getState(), | client/pages/account/components/settings/Controller.jsx | 26 | |
| 30 | user: UserStore.getState(), | client/pages/account/components/settings/Controller.jsx | 27 | |
| 31 | password: PasswordStore.getState() | client/pages/account/components/settings/Controller.jsx | 28 | |
| 32 | }; | client/pages/account/components/settings/Controller.jsx | 28 | |
| 33 | }, | client/pages/account/components/settings/Controller.jsx | 29 | |
| 34 | componentDidMount: function componentDidMount() { | client/pages/account/components/settings/Controller.jsx | 31 | |
| 35 | client/pages/account/components/settings/Controller.jsx | 31 | ||
| 36 | 3 | AccountStore.addChangeListener(this.onStoreChange); | client/pages/account/components/settings/Controller.jsx | 33 |
| 37 | 3 | UserStore.addChangeListener(this.onStoreChange); | client/pages/account/components/settings/Controller.jsx | 34 |
| 38 | 3 | PasswordStore.addChangeListener(this.onStoreChange); | client/pages/account/components/settings/Controller.jsx | 35 |
| 39 | }, | client/pages/account/components/settings/Controller.jsx | 35 | |
| 40 | componentWillUnmount: function componentWillUnmount() { | client/pages/account/components/settings/Controller.jsx | 37 | |
| 41 | client/pages/account/components/settings/Controller.jsx | 37 | ||
| 42 | 1 | AccountStore.removeChangeListener(this.onStoreChange); | client/pages/account/components/settings/Controller.jsx | 39 |
| 43 | 1 | UserStore.removeChangeListener(this.onStoreChange); | client/pages/account/components/settings/Controller.jsx | 40 |
| 44 | 1 | PasswordStore.removeChangeListener(this.onStoreChange); | client/pages/account/components/settings/Controller.jsx | 41 |
| 45 | }, | client/pages/account/components/settings/Controller.jsx | 41 | |
| 46 | onStoreChange: function onStoreChange() { | client/pages/account/components/settings/Controller.jsx | 43 | |
| 47 | client/pages/account/components/settings/Controller.jsx | 43 | ||
| 48 | 30 | this.setState(this.getStateFromStores()); | client/pages/account/components/settings/Controller.jsx | 45 |
| 49 | }, | client/pages/account/components/settings/Controller.jsx | 45 | |
| 50 | render: function render() { | client/pages/account/components/settings/Controller.jsx | 47 | |
| 51 | client/pages/account/components/settings/Controller.jsx | 47 | ||
| 52 | 33 | return React.createElement( | client/pages/account/components/settings/Controller.jsx | 49 |
| 53 | 'section', | client/pages/account/components/settings/Controller.jsx | 50 | |
| 54 | { className: 'section-settings container' }, | client/pages/account/components/settings/Controller.jsx | 50 | |
| 55 | React.createElement( | client/pages/account/components/settings/Controller.jsx | 50 | |
| 56 | 'h1', | client/pages/account/components/settings/Controller.jsx | 51 | |
| 57 | { className: 'page-header' }, | client/pages/account/components/settings/Controller.jsx | 51 | |
| 58 | 'Account settings' | client/pages/account/components/settings/Controller.jsx | 51 | |
| 59 | ), | client/pages/account/components/settings/Controller.jsx | 51 | |
| 60 | React.createElement( | client/pages/account/components/settings/Controller.jsx | 51 | |
| 61 | 'div', | client/pages/account/components/settings/Controller.jsx | 52 | |
| 62 | { className: 'row' }, | client/pages/account/components/settings/Controller.jsx | 52 | |
| 63 | React.createElement( | client/pages/account/components/settings/Controller.jsx | 52 | |
| 64 | 'div', | client/pages/account/components/settings/Controller.jsx | 53 | |
| 65 | { className: 'col-sm-6' }, | client/pages/account/components/settings/Controller.jsx | 53 | |
| 66 | React.createElement(AccountForm, { data: this.state.account }), | client/pages/account/components/settings/Controller.jsx | 53 | |
| 67 | React.createElement(UserForm, { data: this.state.user }), | client/pages/account/components/settings/Controller.jsx | 54 | |
| 68 | React.createElement(PasswordForm, { data: this.state.password }) | client/pages/account/components/settings/Controller.jsx | 55 | |
| 69 | ) | client/pages/account/components/settings/Controller.jsx | 56 | |
| 70 | ) | client/pages/account/components/settings/Controller.jsx | 57 | |
| 71 | ); | client/pages/account/components/settings/Controller.jsx | 58 | |
| 72 | } | client/pages/account/components/settings/Controller.jsx | 60 | |
| 73 | }); | client/pages/account/components/settings/Controller.jsx | 61 | |
| 74 | client/pages/account/components/settings/Controller.jsx | 62 | ||
| 75 | 1 | module.exports = Component; | client/pages/account/components/settings/Controller.jsx | 65 |
| 76 | client/pages/account/components/settings/Controller.jsx | 65 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/settings/PasswordForm.jsx | 1 | |
| 2 | client/pages/account/components/settings/PasswordForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/settings/PasswordForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/account/components/settings/PasswordForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/account/components/settings/PasswordForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/account/components/settings/PasswordForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/account/components/settings/PasswordForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../Actions'); | client/pages/account/components/settings/PasswordForm.jsx | 6 |
| 9 | client/pages/account/components/settings/PasswordForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/account/components/settings/PasswordForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/account/components/settings/PasswordForm.jsx | 9 | |
| 12 | client/pages/account/components/settings/PasswordForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/account/components/settings/PasswordForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/account/components/settings/PasswordForm.jsx | 11 | |
| 15 | client/pages/account/components/settings/PasswordForm.jsx | 11 | ||
| 16 | 10 | return {}; | client/pages/account/components/settings/PasswordForm.jsx | 13 |
| 17 | }, | client/pages/account/components/settings/PasswordForm.jsx | 13 | |
| 18 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/account/components/settings/PasswordForm.jsx | 15 | |
| 19 | client/pages/account/components/settings/PasswordForm.jsx | 15 | ||
| 20 | 32 | if (nextProps.data.success) { | client/pages/account/components/settings/PasswordForm.jsx | 17 |
| 21 | 1 | this.replaceState({}); | client/pages/account/components/settings/PasswordForm.jsx | 18 |
| 22 | } | client/pages/account/components/settings/PasswordForm.jsx | 18 | |
| 23 | }, | client/pages/account/components/settings/PasswordForm.jsx | 19 | |
| 24 | handleSubmit: function handleSubmit(event) { | client/pages/account/components/settings/PasswordForm.jsx | 21 | |
| 25 | client/pages/account/components/settings/PasswordForm.jsx | 21 | ||
| 26 | 1 | event.preventDefault(); | client/pages/account/components/settings/PasswordForm.jsx | 23 |
| 27 | 1 | event.stopPropagation(); | client/pages/account/components/settings/PasswordForm.jsx | 24 |
| 28 | client/pages/account/components/settings/PasswordForm.jsx | 24 | ||
| 29 | 1 | Actions.savePasswordSettings({ | client/pages/account/components/settings/PasswordForm.jsx | 26 |
| 30 | password: this.state.password, | client/pages/account/components/settings/PasswordForm.jsx | 27 | |
| 31 | passwordConfirm: this.state.passwordConfirm | client/pages/account/components/settings/PasswordForm.jsx | 28 | |
| 32 | }); | client/pages/account/components/settings/PasswordForm.jsx | 28 | |
| 33 | }, | client/pages/account/components/settings/PasswordForm.jsx | 29 | |
| 34 | render: function render() { | client/pages/account/components/settings/PasswordForm.jsx | 31 | |
| 35 | client/pages/account/components/settings/PasswordForm.jsx | 31 | ||
| 36 | 42 | var alerts = []; | client/pages/account/components/settings/PasswordForm.jsx | 33 |
| 37 | 42 | if (this.props.data.success) { | client/pages/account/components/settings/PasswordForm.jsx | 34 |
| 38 | 2 | alerts.push(React.createElement( | client/pages/account/components/settings/PasswordForm.jsx | 35 |
| 39 | 'div', | client/pages/account/components/settings/PasswordForm.jsx | 35 | |
| 40 | { key: 'success', className: 'alert alert-success' }, | client/pages/account/components/settings/PasswordForm.jsx | 35 | |
| 41 | 'Success. New password set.' | client/pages/account/components/settings/PasswordForm.jsx | 35 | |
| 42 | )); | client/pages/account/components/settings/PasswordForm.jsx | 35 | |
| 43 | 40 | } else if (this.props.data.error) { | client/pages/account/components/settings/PasswordForm.jsx | 37 |
| 44 | 5 | alerts.push(React.createElement( | client/pages/account/components/settings/PasswordForm.jsx | 40 |
| 45 | 'div', | client/pages/account/components/settings/PasswordForm.jsx | 40 | |
| 46 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/account/components/settings/PasswordForm.jsx | 40 | |
| 47 | this.props.data.error | client/pages/account/components/settings/PasswordForm.jsx | 40 | |
| 48 | )); | client/pages/account/components/settings/PasswordForm.jsx | 41 | |
| 49 | } | client/pages/account/components/settings/PasswordForm.jsx | 42 | |
| 50 | client/pages/account/components/settings/PasswordForm.jsx | 43 | ||
| 51 | 42 | return React.createElement( | client/pages/account/components/settings/PasswordForm.jsx | 45 |
| 52 | 'form', | client/pages/account/components/settings/PasswordForm.jsx | 46 | |
| 53 | { onSubmit: this.handleSubmit }, | client/pages/account/components/settings/PasswordForm.jsx | 46 | |
| 54 | React.createElement( | client/pages/account/components/settings/PasswordForm.jsx | 46 | |
| 55 | 'fieldset', | client/pages/account/components/settings/PasswordForm.jsx | 47 | |
| 56 | null, | client/pages/account/components/settings/PasswordForm.jsx | 47 | |
| 57 | React.createElement( | client/pages/account/components/settings/PasswordForm.jsx | 47 | |
| 58 | 'legend', | client/pages/account/components/settings/PasswordForm.jsx | 48 | |
| 59 | null, | client/pages/account/components/settings/PasswordForm.jsx | 48 | |
| 60 | 'Password' | client/pages/account/components/settings/PasswordForm.jsx | 48 | |
| 61 | ), | client/pages/account/components/settings/PasswordForm.jsx | 48 | |
| 62 | alerts, | client/pages/account/components/settings/PasswordForm.jsx | 48 | |
| 63 | React.createElement(TextControl, { | client/pages/account/components/settings/PasswordForm.jsx | 49 | |
| 64 | name: 'password', | client/pages/account/components/settings/PasswordForm.jsx | 51 | |
| 65 | label: 'New password', | client/pages/account/components/settings/PasswordForm.jsx | 52 | |
| 66 | type: 'password', | client/pages/account/components/settings/PasswordForm.jsx | 53 | |
| 67 | hasError: this.props.data.hasError.password, | client/pages/account/components/settings/PasswordForm.jsx | 54 | |
| 68 | valueLink: this.linkState('password'), | client/pages/account/components/settings/PasswordForm.jsx | 55 | |
| 69 | help: this.props.data.help.password, | client/pages/account/components/settings/PasswordForm.jsx | 56 | |
| 70 | disabled: this.props.data.loading | client/pages/account/components/settings/PasswordForm.jsx | 57 | |
| 71 | }), | client/pages/account/components/settings/PasswordForm.jsx | 57 | |
| 72 | React.createElement(TextControl, { | client/pages/account/components/settings/PasswordForm.jsx | 58 | |
| 73 | name: 'passwordConfirm', | client/pages/account/components/settings/PasswordForm.jsx | 60 | |
| 74 | label: 'Confirm new password', | client/pages/account/components/settings/PasswordForm.jsx | 61 | |
| 75 | type: 'password', | client/pages/account/components/settings/PasswordForm.jsx | 62 | |
| 76 | hasError: this.props.data.hasError.passwordConfirm, | client/pages/account/components/settings/PasswordForm.jsx | 63 | |
| 77 | valueLink: this.linkState('passwordConfirm'), | client/pages/account/components/settings/PasswordForm.jsx | 64 | |
| 78 | help: this.props.data.help.passwordConfirm, | client/pages/account/components/settings/PasswordForm.jsx | 65 | |
| 79 | disabled: this.props.data.loading | client/pages/account/components/settings/PasswordForm.jsx | 66 | |
| 80 | }), | client/pages/account/components/settings/PasswordForm.jsx | 66 | |
| 81 | React.createElement( | client/pages/account/components/settings/PasswordForm.jsx | 67 | |
| 82 | ControlGroup, | client/pages/account/components/settings/PasswordForm.jsx | 68 | |
| 83 | { hideLabel: true, hideHelp: true }, | client/pages/account/components/settings/PasswordForm.jsx | 68 | |
| 84 | React.createElement( | client/pages/account/components/settings/PasswordForm.jsx | 68 | |
| 85 | Button, | client/pages/account/components/settings/PasswordForm.jsx | 69 | |
| 86 | { | client/pages/account/components/settings/PasswordForm.jsx | 69 | |
| 87 | type: 'submit', | client/pages/account/components/settings/PasswordForm.jsx | 70 | |
| 88 | inputClasses: { 'btn-primary': true }, | client/pages/account/components/settings/PasswordForm.jsx | 71 | |
| 89 | disabled: this.props.data.loading }, | client/pages/account/components/settings/PasswordForm.jsx | 72 | |
| 90 | 'Set password', | client/pages/account/components/settings/PasswordForm.jsx | 72 | |
| 91 | React.createElement(Spinner, { | client/pages/account/components/settings/PasswordForm.jsx | 72 | |
| 92 | space: 'left', | client/pages/account/components/settings/PasswordForm.jsx | 76 | |
| 93 | show: this.props.data.loading | client/pages/account/components/settings/PasswordForm.jsx | 77 | |
| 94 | }) | client/pages/account/components/settings/PasswordForm.jsx | 77 | |
| 95 | ) | client/pages/account/components/settings/PasswordForm.jsx | 78 | |
| 96 | ) | client/pages/account/components/settings/PasswordForm.jsx | 79 | |
| 97 | ) | client/pages/account/components/settings/PasswordForm.jsx | 80 | |
| 98 | ); | client/pages/account/components/settings/PasswordForm.jsx | 81 | |
| 99 | } | client/pages/account/components/settings/PasswordForm.jsx | 83 | |
| 100 | }); | client/pages/account/components/settings/PasswordForm.jsx | 84 | |
| 101 | client/pages/account/components/settings/PasswordForm.jsx | 85 | ||
| 102 | 1 | module.exports = Component; | client/pages/account/components/settings/PasswordForm.jsx | 88 |
| 103 | client/pages/account/components/settings/PasswordForm.jsx | 88 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/account/components/settings/UserForm.jsx | 1 | |
| 2 | client/pages/account/components/settings/UserForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/account/components/settings/UserForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/account/components/settings/UserForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/account/components/settings/UserForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/account/components/settings/UserForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/account/components/settings/UserForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../Actions'); | client/pages/account/components/settings/UserForm.jsx | 6 |
| 9 | client/pages/account/components/settings/UserForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/account/components/settings/UserForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/account/components/settings/UserForm.jsx | 9 | |
| 12 | client/pages/account/components/settings/UserForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/account/components/settings/UserForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/account/components/settings/UserForm.jsx | 11 | |
| 15 | client/pages/account/components/settings/UserForm.jsx | 11 | ||
| 16 | 10 | return {}; | client/pages/account/components/settings/UserForm.jsx | 13 |
| 17 | }, | client/pages/account/components/settings/UserForm.jsx | 13 | |
| 18 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/account/components/settings/UserForm.jsx | 15 | |
| 19 | client/pages/account/components/settings/UserForm.jsx | 15 | ||
| 20 | 32 | if (!this.state.hydrated) { | client/pages/account/components/settings/UserForm.jsx | 17 |
| 21 | 19 | this.setState({ | client/pages/account/components/settings/UserForm.jsx | 18 |
| 22 | hydrated: nextProps.data.hydrated, | client/pages/account/components/settings/UserForm.jsx | 19 | |
| 23 | username: nextProps.data.username, | client/pages/account/components/settings/UserForm.jsx | 20 | |
| 24 | email: nextProps.data.email | client/pages/account/components/settings/UserForm.jsx | 21 | |
| 25 | }); | client/pages/account/components/settings/UserForm.jsx | 21 | |
| 26 | } | client/pages/account/components/settings/UserForm.jsx | 22 | |
| 27 | }, | client/pages/account/components/settings/UserForm.jsx | 23 | |
| 28 | handleSubmit: function handleSubmit(event) { | client/pages/account/components/settings/UserForm.jsx | 25 | |
| 29 | client/pages/account/components/settings/UserForm.jsx | 25 | ||
| 30 | 1 | event.preventDefault(); | client/pages/account/components/settings/UserForm.jsx | 27 |
| 31 | 1 | event.stopPropagation(); | client/pages/account/components/settings/UserForm.jsx | 28 |
| 32 | client/pages/account/components/settings/UserForm.jsx | 28 | ||
| 33 | 1 | Actions.saveUserSettings({ | client/pages/account/components/settings/UserForm.jsx | 30 |
| 34 | username: this.state.username, | client/pages/account/components/settings/UserForm.jsx | 31 | |
| 35 | email: this.state.email | client/pages/account/components/settings/UserForm.jsx | 32 | |
| 36 | }); | client/pages/account/components/settings/UserForm.jsx | 32 | |
| 37 | }, | client/pages/account/components/settings/UserForm.jsx | 33 | |
| 38 | render: function render() { | client/pages/account/components/settings/UserForm.jsx | 35 | |
| 39 | client/pages/account/components/settings/UserForm.jsx | 35 | ||
| 40 | 42 | var alerts = []; | client/pages/account/components/settings/UserForm.jsx | 37 |
| 41 | 42 | if (this.props.data.success) { | client/pages/account/components/settings/UserForm.jsx | 38 |
| 42 | 3 | alerts.push(React.createElement( | client/pages/account/components/settings/UserForm.jsx | 39 |
| 43 | 'div', | client/pages/account/components/settings/UserForm.jsx | 39 | |
| 44 | { key: 'success', className: 'alert alert-success' }, | client/pages/account/components/settings/UserForm.jsx | 39 | |
| 45 | 'Success. Identity settings saved.' | client/pages/account/components/settings/UserForm.jsx | 39 | |
| 46 | )); | client/pages/account/components/settings/UserForm.jsx | 39 | |
| 47 | 39 | } else if (this.props.data.error) { | client/pages/account/components/settings/UserForm.jsx | 41 |
| 48 | 3 | alerts.push(React.createElement( | client/pages/account/components/settings/UserForm.jsx | 44 |
| 49 | 'div', | client/pages/account/components/settings/UserForm.jsx | 44 | |
| 50 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/account/components/settings/UserForm.jsx | 44 | |
| 51 | this.props.data.error | client/pages/account/components/settings/UserForm.jsx | 44 | |
| 52 | )); | client/pages/account/components/settings/UserForm.jsx | 45 | |
| 53 | } | client/pages/account/components/settings/UserForm.jsx | 46 | |
| 54 | client/pages/account/components/settings/UserForm.jsx | 47 | ||
| 55 | 42 | var notice; | client/pages/account/components/settings/UserForm.jsx | 49 |
| 56 | 42 | if (!this.props.data.hydrated) { | client/pages/account/components/settings/UserForm.jsx | 50 |
| 57 | 19 | notice = React.createElement( | client/pages/account/components/settings/UserForm.jsx | 51 |
| 58 | 'div', | client/pages/account/components/settings/UserForm.jsx | 51 | |
| 59 | { className: 'alert alert-info' }, | client/pages/account/components/settings/UserForm.jsx | 51 | |
| 60 | 'Loading identity data...' | client/pages/account/components/settings/UserForm.jsx | 51 | |
| 61 | ); | client/pages/account/components/settings/UserForm.jsx | 51 | |
| 62 | } | client/pages/account/components/settings/UserForm.jsx | 53 | |
| 63 | client/pages/account/components/settings/UserForm.jsx | 54 | ||
| 64 | 42 | var formElements; | client/pages/account/components/settings/UserForm.jsx | 56 |
| 65 | 42 | if (this.props.data.hydrated) { | client/pages/account/components/settings/UserForm.jsx | 57 |
| 66 | 23 | formElements = React.createElement( | client/pages/account/components/settings/UserForm.jsx | 58 |
| 67 | 'fieldset', | client/pages/account/components/settings/UserForm.jsx | 59 | |
| 68 | null, | client/pages/account/components/settings/UserForm.jsx | 59 | |
| 69 | React.createElement( | client/pages/account/components/settings/UserForm.jsx | 59 | |
| 70 | 'legend', | client/pages/account/components/settings/UserForm.jsx | 60 | |
| 71 | null, | client/pages/account/components/settings/UserForm.jsx | 60 | |
| 72 | 'Identity' | client/pages/account/components/settings/UserForm.jsx | 60 | |
| 73 | ), | client/pages/account/components/settings/UserForm.jsx | 60 | |
| 74 | alerts, | client/pages/account/components/settings/UserForm.jsx | 60 | |
| 75 | React.createElement(TextControl, { | client/pages/account/components/settings/UserForm.jsx | 61 | |
| 76 | name: 'username', | client/pages/account/components/settings/UserForm.jsx | 63 | |
| 77 | label: 'Username', | client/pages/account/components/settings/UserForm.jsx | 64 | |
| 78 | hasError: this.props.data.hasError.username, | client/pages/account/components/settings/UserForm.jsx | 65 | |
| 79 | valueLink: this.linkState('username'), | client/pages/account/components/settings/UserForm.jsx | 66 | |
| 80 | help: this.props.data.help.username, | client/pages/account/components/settings/UserForm.jsx | 67 | |
| 81 | disabled: this.props.data.loading | client/pages/account/components/settings/UserForm.jsx | 68 | |
| 82 | }), | client/pages/account/components/settings/UserForm.jsx | 68 | |
| 83 | React.createElement(TextControl, { | client/pages/account/components/settings/UserForm.jsx | 69 | |
| 84 | name: 'email', | client/pages/account/components/settings/UserForm.jsx | 71 | |
| 85 | label: 'Email', | client/pages/account/components/settings/UserForm.jsx | 72 | |
| 86 | hasError: this.props.data.hasError.email, | client/pages/account/components/settings/UserForm.jsx | 73 | |
| 87 | valueLink: this.linkState('email'), | client/pages/account/components/settings/UserForm.jsx | 74 | |
| 88 | help: this.props.data.help.email, | client/pages/account/components/settings/UserForm.jsx | 75 | |
| 89 | disabled: this.props.data.loading | client/pages/account/components/settings/UserForm.jsx | 76 | |
| 90 | }), | client/pages/account/components/settings/UserForm.jsx | 76 | |
| 91 | React.createElement( | client/pages/account/components/settings/UserForm.jsx | 77 | |
| 92 | ControlGroup, | client/pages/account/components/settings/UserForm.jsx | 78 | |
| 93 | { hideLabel: true, hideHelp: true }, | client/pages/account/components/settings/UserForm.jsx | 78 | |
| 94 | React.createElement( | client/pages/account/components/settings/UserForm.jsx | 78 | |
| 95 | Button, | client/pages/account/components/settings/UserForm.jsx | 79 | |
| 96 | { | client/pages/account/components/settings/UserForm.jsx | 79 | |
| 97 | type: 'submit', | client/pages/account/components/settings/UserForm.jsx | 80 | |
| 98 | inputClasses: { 'btn-primary': true }, | client/pages/account/components/settings/UserForm.jsx | 81 | |
| 99 | disabled: this.props.data.loading }, | client/pages/account/components/settings/UserForm.jsx | 82 | |
| 100 | 'Update identity', | client/pages/account/components/settings/UserForm.jsx | 82 | |
| 101 | React.createElement(Spinner, { | client/pages/account/components/settings/UserForm.jsx | 82 | |
| 102 | space: 'left', | client/pages/account/components/settings/UserForm.jsx | 86 | |
| 103 | show: this.props.data.loading | client/pages/account/components/settings/UserForm.jsx | 87 | |
| 104 | }) | client/pages/account/components/settings/UserForm.jsx | 87 | |
| 105 | ) | client/pages/account/components/settings/UserForm.jsx | 88 | |
| 106 | ) | client/pages/account/components/settings/UserForm.jsx | 89 | |
| 107 | ); | client/pages/account/components/settings/UserForm.jsx | 90 | |
| 108 | } | client/pages/account/components/settings/UserForm.jsx | 92 | |
| 109 | client/pages/account/components/settings/UserForm.jsx | 93 | ||
| 110 | 42 | return React.createElement( | client/pages/account/components/settings/UserForm.jsx | 95 |
| 111 | 'form', | client/pages/account/components/settings/UserForm.jsx | 96 | |
| 112 | { onSubmit: this.handleSubmit }, | client/pages/account/components/settings/UserForm.jsx | 96 | |
| 113 | notice, | client/pages/account/components/settings/UserForm.jsx | 96 | |
| 114 | formElements | client/pages/account/components/settings/UserForm.jsx | 97 | |
| 115 | ); | client/pages/account/components/settings/UserForm.jsx | 98 | |
| 116 | } | client/pages/account/components/settings/UserForm.jsx | 100 | |
| 117 | }); | client/pages/account/components/settings/UserForm.jsx | 101 | |
| 118 | client/pages/account/components/settings/UserForm.jsx | 102 | ||
| 119 | 1 | module.exports = Component; | client/pages/account/components/settings/UserForm.jsx | 105 |
| 120 | client/pages/account/components/settings/UserForm.jsx | 105 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../Constants'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | hydrated: false, | |
| 16 | loading: false, | |
| 17 | success: false, | |
| 18 | error: undefined, | |
| 19 | hasError: {}, | |
| 20 | help: {}, | |
| 21 | name: {}, | |
| 22 | timeCreated: undefined | |
| 23 | }, | |
| 24 | getState: function () { | |
| 25 | ||
| 26 | 41 | return this.state; |
| 27 | }, | |
| 28 | reset: function () { | |
| 29 | ||
| 30 | 4 | this.state = CloneDeep(this.defaultState); |
| 31 | }, | |
| 32 | setLoadingState: function () { | |
| 33 | ||
| 34 | 2 | this.state.loading = true; |
| 35 | 2 | this.state.success = false; |
| 36 | 2 | this.state.error = undefined; |
| 37 | 2 | this.state.hasError = {}; |
| 38 | 2 | this.state.help = {}; |
| 39 | }, | |
| 40 | handleResponseErrors: function (data) { | |
| 41 | ||
| 42 | 5 | var validation = ParseValidation(data.validation, data.message); |
| 43 | 5 | var self = this; |
| 44 | ||
| 45 | 5 | this.state.loading = false; |
| 46 | 5 | this.state.success = data.success; |
| 47 | ||
| 48 | 5 | if (this.state.success) { |
| 49 | 1 | setTimeout(function () { |
| 50 | ||
| 51 | 1 | self.state.success = undefined; |
| 52 | 1 | self.emitChange(); |
| 53 | }, 2500); | |
| 54 | } | |
| 55 | ||
| 56 | 5 | this.state.hasError = validation.hasError; |
| 57 | 5 | this.state.help = validation.help; |
| 58 | 5 | this.state.error = validation.error; |
| 59 | }, | |
| 60 | onDispatcherAction: function (payload) { | |
| 61 | ||
| 62 | 154 | var action = payload.action; |
| 63 | ||
| 64 | 154 | if (ActionTypes.GET_ACCOUNT_SETTINGS === action.type) { |
| 65 | 1 | this.setLoadingState(); |
| 66 | 1 | this.state.hydrated = false; |
| 67 | 1 | this.emitChange(); |
| 68 | } | |
| 69 | ||
| 70 | 154 | if (ActionTypes.GET_ACCOUNT_SETTINGS_RESPONSE === action.type) { |
| 71 | 3 | this.handleResponseErrors(action.data); |
| 72 | 3 | this.state.hydrated = true; |
| 73 | 3 | this.state.name = action.data.name; |
| 74 | 3 | this.state.timeCreated = action.data.timeCreated; |
| 75 | 3 | this.emitChange(); |
| 76 | } | |
| 77 | ||
| 78 | 154 | if (ActionTypes.SAVE_ACCOUNT_SETTINGS === action.type) { |
| 79 | 1 | this.setLoadingState(); |
| 80 | 1 | this.emitChange(); |
| 81 | } | |
| 82 | ||
| 83 | 154 | if (ActionTypes.SAVE_ACCOUNT_SETTINGS_RESPONSE === action.type) { |
| 84 | 2 | this.handleResponseErrors(action.data); |
| 85 | 2 | this.emitChange(); |
| 86 | } | |
| 87 | } | |
| 88 | }); | |
| 89 | ||
| 90 | ||
| 91 | 1 | module.exports = Store; |
| 92 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../Constants'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | loading: false, | |
| 16 | success: false, | |
| 17 | error: undefined, | |
| 18 | hasError: {}, | |
| 19 | help: {} | |
| 20 | }, | |
| 21 | getState: function () { | |
| 22 | ||
| 23 | 39 | return this.state; |
| 24 | }, | |
| 25 | reset: function () { | |
| 26 | ||
| 27 | 4 | this.state = CloneDeep(this.defaultState); |
| 28 | }, | |
| 29 | setLoadingState: function () { | |
| 30 | ||
| 31 | 1 | this.state.loading = true; |
| 32 | 1 | this.state.success = false; |
| 33 | 1 | this.state.error = undefined; |
| 34 | 1 | this.state.hasError = {}; |
| 35 | 1 | this.state.help = {}; |
| 36 | }, | |
| 37 | handleResponseErrors: function (data) { | |
| 38 | ||
| 39 | 4 | var validation = ParseValidation(data.validation, data.message); |
| 40 | 4 | var self = this; |
| 41 | ||
| 42 | 4 | this.state.loading = false; |
| 43 | 4 | this.state.success = data.success; |
| 44 | ||
| 45 | 4 | if (this.state.success) { |
| 46 | 1 | setTimeout(function () { |
| 47 | ||
| 48 | 1 | self.state.success = undefined; |
| 49 | 1 | self.emitChange(); |
| 50 | }, 2500); | |
| 51 | } | |
| 52 | ||
| 53 | 4 | this.state.hasError = validation.hasError; |
| 54 | 4 | this.state.help = validation.help; |
| 55 | 4 | this.state.error = validation.error; |
| 56 | }, | |
| 57 | onDispatcherAction: function (payload) { | |
| 58 | ||
| 59 | 154 | var action = payload.action; |
| 60 | ||
| 61 | 154 | if (ActionTypes.SAVE_PASSWORD_SETTINGS === action.type) { |
| 62 | 1 | this.setLoadingState(); |
| 63 | 1 | this.emitChange(); |
| 64 | } | |
| 65 | ||
| 66 | 154 | if (ActionTypes.SAVE_PASSWORD_SETTINGS_RESPONSE === action.type) { |
| 67 | 4 | this.handleResponseErrors(action.data); |
| 68 | 4 | this.emitChange(); |
| 69 | } | |
| 70 | } | |
| 71 | }); | |
| 72 | ||
| 73 | ||
| 74 | 1 | module.exports = Store; |
| 75 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../Constants'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | hydrated: false, | |
| 16 | loading: false, | |
| 17 | success: false, | |
| 18 | error: undefined, | |
| 19 | hasError: {}, | |
| 20 | help: {} | |
| 21 | }, | |
| 22 | getState: function () { | |
| 23 | ||
| 24 | 41 | return this.state; |
| 25 | }, | |
| 26 | reset: function () { | |
| 27 | ||
| 28 | 4 | this.state = CloneDeep(this.defaultState); |
| 29 | }, | |
| 30 | setLoadingState: function () { | |
| 31 | ||
| 32 | 2 | this.state.loading = true; |
| 33 | 2 | this.state.success = false; |
| 34 | 2 | this.state.error = undefined; |
| 35 | 2 | this.state.hasError = {}; |
| 36 | 2 | this.state.help = {}; |
| 37 | }, | |
| 38 | handleResponseErrors: function (data) { | |
| 39 | ||
| 40 | 5 | var validation = ParseValidation(data.validation, data.message); |
| 41 | 5 | var self = this; |
| 42 | ||
| 43 | 5 | this.state.loading = false; |
| 44 | 5 | this.state.success = data.success; |
| 45 | ||
| 46 | 5 | if (this.state.success) { |
| 47 | 2 | setTimeout(function () { |
| 48 | ||
| 49 | 1 | self.state.success = undefined; |
| 50 | 1 | self.emitChange(); |
| 51 | }, 2500); | |
| 52 | } | |
| 53 | ||
| 54 | 5 | this.state.hasError = validation.hasError; |
| 55 | 5 | this.state.help = validation.help; |
| 56 | 5 | this.state.error = validation.error; |
| 57 | }, | |
| 58 | onDispatcherAction: function (payload) { | |
| 59 | ||
| 60 | 154 | var action = payload.action; |
| 61 | ||
| 62 | 154 | if (ActionTypes.GET_USER_SETTINGS === action.type) { |
| 63 | 1 | this.setLoadingState(); |
| 64 | 1 | this.state.hydrated = false; |
| 65 | 1 | this.emitChange(); |
| 66 | } | |
| 67 | ||
| 68 | 154 | if (ActionTypes.GET_USER_SETTINGS_RESPONSE === action.type) { |
| 69 | 3 | this.handleResponseErrors(action.data); |
| 70 | 3 | this.state.hydrated = true; |
| 71 | 3 | this.state.username = action.data.username; |
| 72 | 3 | this.state.email = action.data.email; |
| 73 | 3 | this.emitChange(); |
| 74 | } | |
| 75 | ||
| 76 | 154 | if (ActionTypes.SAVE_USER_SETTINGS === action.type) { |
| 77 | 1 | this.setLoadingState(); |
| 78 | 1 | this.emitChange(); |
| 79 | } | |
| 80 | ||
| 81 | 154 | if (ActionTypes.SAVE_USER_SETTINGS_RESPONSE === action.type) { |
| 82 | 2 | this.handleResponseErrors(action.data); |
| 83 | ||
| 84 | 2 | if (this.state.success) { |
| 85 | 1 | this.state.username = action.data.user.username; |
| 86 | 1 | this.state.email = action.data.user.email; |
| 87 | } | |
| 88 | ||
| 89 | 2 | this.emitChange(); |
| 90 | } | |
| 91 | } | |
| 92 | }); | |
| 93 | ||
| 94 | ||
| 95 | 1 | module.exports = Store; |
| 96 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/Routes.jsx | 1 | |
| 2 | client/pages/admin/Routes.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/Routes.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/Routes.jsx | 2 |
| 5 | 1 | var App = require('./components/App'); | client/pages/admin/Routes.jsx | 3 |
| 6 | 1 | var Home = require('./components/home/Controller'); | client/pages/admin/Routes.jsx | 4 |
| 7 | 1 | var NotFound = require('./components/not-found/Controller'); | client/pages/admin/Routes.jsx | 5 |
| 8 | 1 | var AccountSearch = require('./components/accounts/Search'); | client/pages/admin/Routes.jsx | 6 |
| 9 | 1 | var AccountDetails = require('./components/accounts/Details'); | client/pages/admin/Routes.jsx | 7 |
| 10 | 1 | var AdminSearch = require('./components/admins/Search'); | client/pages/admin/Routes.jsx | 8 |
| 11 | 1 | var AdminDetails = require('./components/admins/Details'); | client/pages/admin/Routes.jsx | 9 |
| 12 | 1 | var AdminGroupSearch = require('./components/admin-groups/Search'); | client/pages/admin/Routes.jsx | 10 |
| 13 | 1 | var AdminGroupDetails = require('./components/admin-groups/Details'); | client/pages/admin/Routes.jsx | 11 |
| 14 | 1 | var StatusSearch = require('./components/statuses/Search'); | client/pages/admin/Routes.jsx | 12 |
| 15 | 1 | var StatusDetails = require('./components/statuses/Details'); | client/pages/admin/Routes.jsx | 13 |
| 16 | 1 | var UserSearch = require('./components/users/Search'); | client/pages/admin/Routes.jsx | 14 |
| 17 | 1 | var UserDetails = require('./components/users/Details'); | client/pages/admin/Routes.jsx | 15 |
| 18 | client/pages/admin/Routes.jsx | 15 | ||
| 19 | 1 | var Route = ReactRouter.Route; | client/pages/admin/Routes.jsx | 18 |
| 20 | 1 | var DefaultRoute = ReactRouter.DefaultRoute; | client/pages/admin/Routes.jsx | 19 |
| 21 | 1 | var NotFoundRoute = ReactRouter.NotFoundRoute; | client/pages/admin/Routes.jsx | 20 |
| 22 | client/pages/admin/Routes.jsx | 20 | ||
| 23 | 1 | var routes = React.createElement( | client/pages/admin/Routes.jsx | 23 |
| 24 | Route, | client/pages/admin/Routes.jsx | 24 | |
| 25 | { path: '/admin', name: 'app', handler: App }, | client/pages/admin/Routes.jsx | 24 | |
| 26 | React.createElement(DefaultRoute, { name: 'home', handler: Home }), | client/pages/admin/Routes.jsx | 24 | |
| 27 | React.createElement(NotFoundRoute, { name: 'notFound', handler: NotFound }), | client/pages/admin/Routes.jsx | 25 | |
| 28 | React.createElement(Route, { path: 'accounts', name: 'accounts', handler: AccountSearch }), | client/pages/admin/Routes.jsx | 26 | |
| 29 | React.createElement(Route, { path: 'accounts/:id', name: 'accountDetails', handler: AccountDetails }), | client/pages/admin/Routes.jsx | 28 | |
| 30 | React.createElement(Route, { path: 'admins', name: 'admins', handler: AdminSearch }), | client/pages/admin/Routes.jsx | 29 | |
| 31 | React.createElement(Route, { path: 'admins/:id', name: 'adminDetails', handler: AdminDetails }), | client/pages/admin/Routes.jsx | 30 | |
| 32 | React.createElement(Route, { path: 'admin-groups', name: 'adminGroups', handler: AdminGroupSearch }), | client/pages/admin/Routes.jsx | 31 | |
| 33 | React.createElement(Route, { path: 'admin-groups/:id', name: 'adminGroupDetails', handler: AdminGroupDetails }), | client/pages/admin/Routes.jsx | 32 | |
| 34 | React.createElement(Route, { path: 'statuses', name: 'statuses', handler: StatusSearch }), | client/pages/admin/Routes.jsx | 33 | |
| 35 | React.createElement(Route, { path: 'statuses/:id', name: 'statusDetails', handler: StatusDetails }), | client/pages/admin/Routes.jsx | 34 | |
| 36 | React.createElement(Route, { path: 'users', name: 'users', handler: UserSearch }), | client/pages/admin/Routes.jsx | 35 | |
| 37 | React.createElement(Route, { path: 'users/:id', name: 'userDetails', handler: UserDetails }) | client/pages/admin/Routes.jsx | 36 | |
| 38 | ); | client/pages/admin/Routes.jsx | 37 | |
| 39 | client/pages/admin/Routes.jsx | 39 | ||
| 40 | 1 | module.exports = routes; | client/pages/admin/Routes.jsx | 42 |
| 41 | client/pages/admin/Routes.jsx | 42 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/index.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/index.jsx | 2 | |
| 3 | client/pages/admin/index.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/index.jsx | 2 |
| 5 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/index.jsx | 3 |
| 6 | 1 | var Routes = require('./Routes'); | client/pages/admin/index.jsx | 4 |
| 7 | client/pages/admin/index.jsx | 4 | ||
| 8 | 1 | var HistoryLocation = ReactRouter.HistoryLocation; | client/pages/admin/index.jsx | 7 |
| 9 | client/pages/admin/index.jsx | 7 | ||
| 10 | 1 | var App = { | client/pages/admin/index.jsx | 10 |
| 11 | blastoff: function blastoff() { | client/pages/admin/index.jsx | 11 | |
| 12 | client/pages/admin/index.jsx | 11 | ||
| 13 | 1 | var self = this; | client/pages/admin/index.jsx | 13 |
| 14 | client/pages/admin/index.jsx | 13 | ||
| 15 | 1 | ReactRouter.run(Routes, HistoryLocation, function (Handler) { | client/pages/admin/index.jsx | 15 |
| 16 | client/pages/admin/index.jsx | 15 | ||
| 17 | 1 | self.mainElement = React.render(React.createElement(Handler, null), window.document.getElementById('app-mount')); | client/pages/admin/index.jsx | 17 |
| 18 | }); | client/pages/admin/index.jsx | 20 | |
| 19 | } | client/pages/admin/index.jsx | 21 | |
| 20 | }; | client/pages/admin/index.jsx | 22 | |
| 21 | client/pages/admin/index.jsx | 23 | ||
| 22 | 1 | module.exports = App; | client/pages/admin/index.jsx | 26 |
| 23 | client/pages/admin/index.jsx | 26 | ||
| 24 | /* $lab:coverage:off$ */ | client/pages/admin/index.jsx | 26 | |
| 25 | if (!module.parent) { | client/pages/admin/index.jsx | 30 | |
| 26 | window.app = App; | client/pages/admin/index.jsx | 31 | |
| 27 | App.blastoff(); | client/pages/admin/index.jsx | 32 | |
| 28 | } | client/pages/admin/index.jsx | 32 | |
| 29 | /* $lab:coverage:on$ */ | client/pages/admin/index.jsx | 33 | |
| 30 | client/pages/admin/index.jsx | 33 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('../constants/Account'); |
| 4 | 1 | var Fetch = require('../../../helpers/jsonFetch'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 8 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 9 | 1 | var Types = Constants.ActionTypes; |
| 10 | 1 | var dispatch = Dispatcher.handleAction; |
| 11 | ||
| 12 | ||
| 13 | 1 | var Actions = { |
| 14 | getResults: function (data) { | |
| 15 | ||
| 16 | 2 | dispatch(VIEW_ACTION, Types.GET_RESULTS, data); |
| 17 | ||
| 18 | 2 | var request = { |
| 19 | method: 'GET', | |
| 20 | url: '/api/accounts', | |
| 21 | query: data, | |
| 22 | useAuth: true | |
| 23 | }; | |
| 24 | ||
| 25 | 2 | Fetch(request, function (err, response) { |
| 26 | ||
| 27 | 2 | if (!err) { |
| 28 | 1 | response.success = true; |
| 29 | } | |
| 30 | ||
| 31 | 2 | dispatch(SERVER_ACTION, Types.GET_RESULTS_RESPONSE, response); |
| 32 | }); | |
| 33 | }, | |
| 34 | getDetails: function (data) { | |
| 35 | ||
| 36 | 2 | dispatch(VIEW_ACTION, Types.GET_DETAILS, data); |
| 37 | ||
| 38 | 2 | var request = { |
| 39 | method: 'GET', | |
| 40 | url: '/api/accounts/' + data.id, | |
| 41 | useAuth: true | |
| 42 | }; | |
| 43 | ||
| 44 | 2 | Fetch(request, function (err, response) { |
| 45 | ||
| 46 | 2 | if (err) { |
| 47 | 1 | response.fetchFailure = true; |
| 48 | 1 | response.error = err.message; |
| 49 | } | |
| 50 | ||
| 51 | 2 | dispatch(SERVER_ACTION, Types.GET_DETAILS_RESPONSE, response); |
| 52 | }); | |
| 53 | }, | |
| 54 | linkUser: function (data) { | |
| 55 | ||
| 56 | 2 | dispatch(VIEW_ACTION, Types.LINK_USER, data); |
| 57 | ||
| 58 | 2 | var id = data.id; |
| 59 | 2 | delete data.id; |
| 60 | ||
| 61 | 2 | var request = { |
| 62 | method: 'PUT', | |
| 63 | url: '/api/accounts/' + id + '/user', | |
| 64 | data: data, | |
| 65 | useAuth: true | |
| 66 | }; | |
| 67 | ||
| 68 | 2 | Fetch(request, function (err, response) { |
| 69 | ||
| 70 | 2 | if (!err) { |
| 71 | 1 | response.success = true; |
| 72 | } | |
| 73 | ||
| 74 | 2 | dispatch(SERVER_ACTION, Types.LINK_USER_RESPONSE, response); |
| 75 | }); | |
| 76 | }, | |
| 77 | unlinkUser: function (data) { | |
| 78 | ||
| 79 | 2 | dispatch(VIEW_ACTION, Types.UNLINK_USER, data); |
| 80 | ||
| 81 | 2 | var id = data.id; |
| 82 | 2 | delete data.id; |
| 83 | ||
| 84 | 2 | var request = { |
| 85 | method: 'DELETE', | |
| 86 | url: '/api/accounts/' + id + '/user', | |
| 87 | data: data, | |
| 88 | useAuth: true | |
| 89 | }; | |
| 90 | ||
| 91 | 2 | Fetch(request, function (err, response) { |
| 92 | ||
| 93 | 2 | if (!err) { |
| 94 | 1 | response.success = true; |
| 95 | } | |
| 96 | ||
| 97 | 2 | dispatch(SERVER_ACTION, Types.UNLINK_USER_RESPONSE, response); |
| 98 | }); | |
| 99 | }, | |
| 100 | newStatus: function (data) { | |
| 101 | ||
| 102 | 2 | dispatch(VIEW_ACTION, Types.NEW_STATUS, data); |
| 103 | ||
| 104 | 2 | var id = data.id; |
| 105 | 2 | delete data.id; |
| 106 | ||
| 107 | 2 | var request = { |
| 108 | method: 'POST', | |
| 109 | url: '/api/accounts/' + id + '/status', | |
| 110 | data: data, | |
| 111 | useAuth: true | |
| 112 | }; | |
| 113 | ||
| 114 | 2 | Fetch(request, function (err, response) { |
| 115 | ||
| 116 | 2 | if (!err) { |
| 117 | 1 | response.success = true; |
| 118 | } | |
| 119 | ||
| 120 | 2 | dispatch(SERVER_ACTION, Types.NEW_STATUS_RESPONSE, response); |
| 121 | }); | |
| 122 | }, | |
| 123 | newNote: function (data) { | |
| 124 | ||
| 125 | 2 | dispatch(VIEW_ACTION, Types.NEW_NOTE, data); |
| 126 | ||
| 127 | 2 | var id = data.id; |
| 128 | 2 | delete data.id; |
| 129 | ||
| 130 | 2 | var request = { |
| 131 | method: 'POST', | |
| 132 | url: '/api/accounts/' + id + '/notes', | |
| 133 | data: data, | |
| 134 | useAuth: true | |
| 135 | }; | |
| 136 | ||
| 137 | 2 | Fetch(request, function (err, response) { |
| 138 | ||
| 139 | 2 | if (!err) { |
| 140 | 1 | response.success = true; |
| 141 | } | |
| 142 | ||
| 143 | 2 | dispatch(SERVER_ACTION, Types.NEW_NOTE_RESPONSE, response); |
| 144 | }); | |
| 145 | }, | |
| 146 | showCreateNew: function (data) { | |
| 147 | ||
| 148 | 2 | dispatch(VIEW_ACTION, Types.SHOW_CREATE_NEW, data); |
| 149 | }, | |
| 150 | hideCreateNew: function (data) { | |
| 151 | ||
| 152 | 1 | dispatch(VIEW_ACTION, Types.HIDE_CREATE_NEW, data); |
| 153 | }, | |
| 154 | createNew: function (data, router) { | |
| 155 | ||
| 156 | 3 | dispatch(VIEW_ACTION, Types.CREATE_NEW, data); |
| 157 | ||
| 158 | 3 | var request = { |
| 159 | method: 'POST', | |
| 160 | url: '/api/accounts', | |
| 161 | data: data, | |
| 162 | useAuth: true | |
| 163 | }; | |
| 164 | ||
| 165 | 3 | Fetch(request, function (err, response) { |
| 166 | ||
| 167 | 3 | if (!err) { |
| 168 | 2 | response.success = true; |
| 169 | ||
| 170 | 2 | if (router) { |
| 171 | 1 | router.transitionTo('accountDetails', { id: response._id }); |
| 172 | 1 | window.scrollTo(0, 0); |
| 173 | } | |
| 174 | } | |
| 175 | ||
| 176 | 3 | dispatch(SERVER_ACTION, Types.CREATE_NEW_RESPONSE, response); |
| 177 | }); | |
| 178 | }, | |
| 179 | saveDetails: function (data) { | |
| 180 | ||
| 181 | 2 | dispatch(VIEW_ACTION, Types.SAVE_DETAILS, data); |
| 182 | ||
| 183 | 2 | var id = data.id; |
| 184 | 2 | delete data.id; |
| 185 | ||
| 186 | 2 | var request = { |
| 187 | method: 'PUT', | |
| 188 | url: '/api/accounts/' + id, | |
| 189 | data: data, | |
| 190 | useAuth: true | |
| 191 | }; | |
| 192 | ||
| 193 | 2 | Fetch(request, function (err, response) { |
| 194 | ||
| 195 | 2 | if (!err) { |
| 196 | 1 | response.success = true; |
| 197 | } | |
| 198 | ||
| 199 | 2 | dispatch(SERVER_ACTION, Types.SAVE_DETAILS_RESPONSE, response); |
| 200 | }); | |
| 201 | }, | |
| 202 | delete: function (data, router) { | |
| 203 | ||
| 204 | 3 | dispatch(VIEW_ACTION, Types.DELETE, data); |
| 205 | ||
| 206 | 3 | var id = data.id; |
| 207 | 3 | delete data.id; |
| 208 | ||
| 209 | 3 | var request = { |
| 210 | method: 'DELETE', | |
| 211 | url: '/api/accounts/' + id, | |
| 212 | data: data, | |
| 213 | useAuth: true | |
| 214 | }; | |
| 215 | ||
| 216 | 3 | Fetch(request, function (err, response) { |
| 217 | ||
| 218 | 3 | if (!err) { |
| 219 | 2 | response.success = true; |
| 220 | ||
| 221 | 2 | if (router) { |
| 222 | 1 | router.transitionTo('accounts'); |
| 223 | 1 | window.scrollTo(0, 0); |
| 224 | } | |
| 225 | } | |
| 226 | ||
| 227 | 3 | dispatch(SERVER_ACTION, Types.DELETE_RESPONSE, response); |
| 228 | }); | |
| 229 | } | |
| 230 | }; | |
| 231 | ||
| 232 | ||
| 233 | 1 | module.exports = Actions; |
| 234 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('../constants/Admin'); |
| 4 | 1 | var Fetch = require('../../../helpers/jsonFetch'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 8 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 9 | 1 | var Types = Constants.ActionTypes; |
| 10 | 1 | var dispatch = Dispatcher.handleAction; |
| 11 | ||
| 12 | ||
| 13 | 1 | var Actions = { |
| 14 | getResults: function (data) { | |
| 15 | ||
| 16 | 2 | dispatch(VIEW_ACTION, Types.GET_RESULTS, data); |
| 17 | ||
| 18 | 2 | var request = { |
| 19 | method: 'GET', | |
| 20 | url: '/api/admins', | |
| 21 | query: data, | |
| 22 | useAuth: true | |
| 23 | }; | |
| 24 | ||
| 25 | 2 | Fetch(request, function (err, response) { |
| 26 | ||
| 27 | 2 | if (!err) { |
| 28 | 1 | response.success = true; |
| 29 | } | |
| 30 | ||
| 31 | 2 | dispatch(SERVER_ACTION, Types.GET_RESULTS_RESPONSE, response); |
| 32 | }); | |
| 33 | }, | |
| 34 | getDetails: function (data) { | |
| 35 | ||
| 36 | 2 | dispatch(VIEW_ACTION, Types.GET_DETAILS, data); |
| 37 | ||
| 38 | 2 | var request = { |
| 39 | method: 'GET', | |
| 40 | url: '/api/admins/' + data.id, | |
| 41 | useAuth: true | |
| 42 | }; | |
| 43 | ||
| 44 | 2 | Fetch(request, function (err, response) { |
| 45 | ||
| 46 | 2 | if (err) { |
| 47 | 1 | response.fetchFailure = true; |
| 48 | 1 | response.error = err.message; |
| 49 | } | |
| 50 | ||
| 51 | 2 | dispatch(SERVER_ACTION, Types.GET_DETAILS_RESPONSE, response); |
| 52 | }); | |
| 53 | }, | |
| 54 | showCreateNew: function (data) { | |
| 55 | ||
| 56 | 2 | dispatch(VIEW_ACTION, Types.SHOW_CREATE_NEW, data); |
| 57 | }, | |
| 58 | hideCreateNew: function (data) { | |
| 59 | ||
| 60 | 1 | dispatch(VIEW_ACTION, Types.HIDE_CREATE_NEW, data); |
| 61 | }, | |
| 62 | createNew: function (data, router) { | |
| 63 | ||
| 64 | 3 | dispatch(VIEW_ACTION, Types.CREATE_NEW, data); |
| 65 | ||
| 66 | 3 | var request = { |
| 67 | method: 'POST', | |
| 68 | url: '/api/admins', | |
| 69 | data: data, | |
| 70 | useAuth: true | |
| 71 | }; | |
| 72 | ||
| 73 | 3 | Fetch(request, function (err, response) { |
| 74 | ||
| 75 | 3 | if (!err) { |
| 76 | 2 | response.success = true; |
| 77 | ||
| 78 | 2 | if (router) { |
| 79 | 1 | router.transitionTo('adminDetails', { id: response._id }); |
| 80 | 1 | window.scrollTo(0, 0); |
| 81 | } | |
| 82 | } | |
| 83 | ||
| 84 | 3 | dispatch(SERVER_ACTION, Types.CREATE_NEW_RESPONSE, response); |
| 85 | }); | |
| 86 | }, | |
| 87 | saveDetails: function (data) { | |
| 88 | ||
| 89 | 2 | dispatch(VIEW_ACTION, Types.SAVE_DETAILS, data); |
| 90 | ||
| 91 | 2 | var id = data.id; |
| 92 | 2 | delete data.id; |
| 93 | ||
| 94 | 2 | var request = { |
| 95 | method: 'PUT', | |
| 96 | url: '/api/admins/' + id, | |
| 97 | data: data, | |
| 98 | useAuth: true | |
| 99 | }; | |
| 100 | ||
| 101 | 2 | Fetch(request, function (err, response) { |
| 102 | ||
| 103 | 2 | if (!err) { |
| 104 | 1 | response.success = true; |
| 105 | } | |
| 106 | ||
| 107 | 2 | dispatch(SERVER_ACTION, Types.SAVE_DETAILS_RESPONSE, response); |
| 108 | }); | |
| 109 | }, | |
| 110 | linkUser: function (data) { | |
| 111 | ||
| 112 | 2 | dispatch(VIEW_ACTION, Types.LINK_USER, data); |
| 113 | ||
| 114 | 2 | var id = data.id; |
| 115 | 2 | delete data.id; |
| 116 | ||
| 117 | 2 | var request = { |
| 118 | method: 'PUT', | |
| 119 | url: '/api/admins/' + id + '/user', | |
| 120 | data: data, | |
| 121 | useAuth: true | |
| 122 | }; | |
| 123 | ||
| 124 | 2 | Fetch(request, function (err, response) { |
| 125 | ||
| 126 | 2 | if (!err) { |
| 127 | 1 | response.success = true; |
| 128 | } | |
| 129 | ||
| 130 | 2 | dispatch(SERVER_ACTION, Types.LINK_USER_RESPONSE, response); |
| 131 | }); | |
| 132 | }, | |
| 133 | unlinkUser: function (data) { | |
| 134 | ||
| 135 | 2 | dispatch(VIEW_ACTION, Types.UNLINK_USER, data); |
| 136 | ||
| 137 | 2 | var id = data.id; |
| 138 | 2 | delete data.id; |
| 139 | ||
| 140 | 2 | var request = { |
| 141 | method: 'DELETE', | |
| 142 | url: '/api/admins/' + id + '/user', | |
| 143 | data: data, | |
| 144 | useAuth: true | |
| 145 | }; | |
| 146 | ||
| 147 | 2 | Fetch(request, function (err, response) { |
| 148 | ||
| 149 | 2 | if (!err) { |
| 150 | 1 | response.success = true; |
| 151 | } | |
| 152 | ||
| 153 | 2 | dispatch(SERVER_ACTION, Types.UNLINK_USER_RESPONSE, response); |
| 154 | }); | |
| 155 | }, | |
| 156 | saveGroups: function (data) { | |
| 157 | ||
| 158 | 2 | dispatch(VIEW_ACTION, Types.SAVE_GROUPS, data); |
| 159 | ||
| 160 | 2 | var id = data.id; |
| 161 | 2 | delete data.id; |
| 162 | ||
| 163 | 2 | var request = { |
| 164 | method: 'PUT', | |
| 165 | url: '/api/admins/' + id + '/groups', | |
| 166 | data: data, | |
| 167 | useAuth: true | |
| 168 | }; | |
| 169 | ||
| 170 | 2 | Fetch(request, function (err, response) { |
| 171 | ||
| 172 | 2 | if (!err) { |
| 173 | 1 | response.success = true; |
| 174 | } | |
| 175 | ||
| 176 | 2 | dispatch(SERVER_ACTION, Types.SAVE_GROUPS_RESPONSE, response); |
| 177 | }); | |
| 178 | }, | |
| 179 | savePermissions: function (data) { | |
| 180 | ||
| 181 | 2 | dispatch(VIEW_ACTION, Types.SAVE_PERMISSIONS, data); |
| 182 | ||
| 183 | 2 | var id = data.id; |
| 184 | 2 | delete data.id; |
| 185 | ||
| 186 | 2 | var request = { |
| 187 | method: 'PUT', | |
| 188 | url: '/api/admins/' + id + '/permissions', | |
| 189 | data: data, | |
| 190 | useAuth: true | |
| 191 | }; | |
| 192 | ||
| 193 | 2 | Fetch(request, function (err, response) { |
| 194 | ||
| 195 | 2 | if (!err) { |
| 196 | 1 | response.success = true; |
| 197 | } | |
| 198 | ||
| 199 | 2 | dispatch(SERVER_ACTION, Types.SAVE_PERMISSIONS_RESPONSE, response); |
| 200 | }); | |
| 201 | }, | |
| 202 | delete: function (data, router) { | |
| 203 | ||
| 204 | 3 | dispatch(VIEW_ACTION, Types.DELETE, data); |
| 205 | ||
| 206 | 3 | var id = data.id; |
| 207 | 3 | delete data.id; |
| 208 | ||
| 209 | 3 | var request = { |
| 210 | method: 'DELETE', | |
| 211 | url: '/api/admins/' + id, | |
| 212 | data: data, | |
| 213 | useAuth: true | |
| 214 | }; | |
| 215 | ||
| 216 | 3 | Fetch(request, function (err, response) { |
| 217 | ||
| 218 | 3 | if (!err) { |
| 219 | 2 | response.success = true; |
| 220 | ||
| 221 | 2 | if (router) { |
| 222 | 1 | router.transitionTo('admins'); |
| 223 | 1 | window.scrollTo(0, 0); |
| 224 | } | |
| 225 | } | |
| 226 | ||
| 227 | 3 | dispatch(SERVER_ACTION, Types.DELETE_RESPONSE, response); |
| 228 | }); | |
| 229 | } | |
| 230 | }; | |
| 231 | ||
| 232 | ||
| 233 | 1 | module.exports = Actions; |
| 234 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('../constants/AdminGroup'); |
| 4 | 1 | var Fetch = require('../../../helpers/jsonFetch'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 8 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 9 | 1 | var Types = Constants.ActionTypes; |
| 10 | 1 | var dispatch = Dispatcher.handleAction; |
| 11 | ||
| 12 | ||
| 13 | 1 | var Actions = { |
| 14 | getResults: function (data) { | |
| 15 | ||
| 16 | 3 | dispatch(VIEW_ACTION, Types.GET_RESULTS, data); |
| 17 | ||
| 18 | 3 | var request = { |
| 19 | method: 'GET', | |
| 20 | url: '/api/admin-groups', | |
| 21 | query: data, | |
| 22 | useAuth: true | |
| 23 | }; | |
| 24 | ||
| 25 | 3 | Fetch(request, function (err, response) { |
| 26 | ||
| 27 | 3 | if (!err) { |
| 28 | 2 | response.success = true; |
| 29 | } | |
| 30 | ||
| 31 | 3 | dispatch(SERVER_ACTION, Types.GET_RESULTS_RESPONSE, response); |
| 32 | }); | |
| 33 | }, | |
| 34 | getDetails: function (data) { | |
| 35 | ||
| 36 | 2 | dispatch(VIEW_ACTION, Types.GET_DETAILS, data); |
| 37 | ||
| 38 | 2 | var request = { |
| 39 | method: 'GET', | |
| 40 | url: '/api/admin-groups/' + data.id, | |
| 41 | useAuth: true | |
| 42 | }; | |
| 43 | ||
| 44 | 2 | Fetch(request, function (err, response) { |
| 45 | ||
| 46 | 2 | if (err) { |
| 47 | 1 | response.fetchFailure = true; |
| 48 | 1 | response.error = err.message; |
| 49 | } | |
| 50 | ||
| 51 | 2 | dispatch(SERVER_ACTION, Types.GET_DETAILS_RESPONSE, response); |
| 52 | }); | |
| 53 | }, | |
| 54 | showCreateNew: function (data) { | |
| 55 | ||
| 56 | 2 | dispatch(VIEW_ACTION, Types.SHOW_CREATE_NEW, data); |
| 57 | }, | |
| 58 | hideCreateNew: function (data) { | |
| 59 | ||
| 60 | 1 | dispatch(VIEW_ACTION, Types.HIDE_CREATE_NEW, data); |
| 61 | }, | |
| 62 | createNew: function (data, router) { | |
| 63 | ||
| 64 | 3 | dispatch(VIEW_ACTION, Types.CREATE_NEW, data); |
| 65 | ||
| 66 | 3 | var request = { |
| 67 | method: 'POST', | |
| 68 | url: '/api/admin-groups', | |
| 69 | data: data, | |
| 70 | useAuth: true | |
| 71 | }; | |
| 72 | ||
| 73 | 3 | Fetch(request, function (err, response) { |
| 74 | ||
| 75 | 3 | if (!err) { |
| 76 | 2 | response.success = true; |
| 77 | ||
| 78 | 2 | if (router) { |
| 79 | 1 | Actions.getResults(router.getCurrentQuery()); |
| 80 | } | |
| 81 | } | |
| 82 | ||
| 83 | 3 | dispatch(SERVER_ACTION, Types.CREATE_NEW_RESPONSE, response); |
| 84 | }); | |
| 85 | }, | |
| 86 | saveDetails: function (data) { | |
| 87 | ||
| 88 | 2 | dispatch(VIEW_ACTION, Types.SAVE_DETAILS, data); |
| 89 | ||
| 90 | 2 | var id = data.id; |
| 91 | 2 | delete data.id; |
| 92 | ||
| 93 | 2 | var request = { |
| 94 | method: 'PUT', | |
| 95 | url: '/api/admin-groups/' + id, | |
| 96 | data: data, | |
| 97 | useAuth: true | |
| 98 | }; | |
| 99 | ||
| 100 | 2 | Fetch(request, function (err, response) { |
| 101 | ||
| 102 | 2 | if (!err) { |
| 103 | 1 | response.success = true; |
| 104 | } | |
| 105 | ||
| 106 | 2 | dispatch(SERVER_ACTION, Types.SAVE_DETAILS_RESPONSE, response); |
| 107 | }); | |
| 108 | }, | |
| 109 | savePermissions: function (data) { | |
| 110 | ||
| 111 | 2 | dispatch(VIEW_ACTION, Types.SAVE_PERMISSIONS, data); |
| 112 | ||
| 113 | 2 | var id = data.id; |
| 114 | 2 | delete data.id; |
| 115 | ||
| 116 | 2 | var request = { |
| 117 | method: 'PUT', | |
| 118 | url: '/api/admin-groups/' + id + '/permissions', | |
| 119 | data: data, | |
| 120 | useAuth: true | |
| 121 | }; | |
| 122 | ||
| 123 | 2 | Fetch(request, function (err, response) { |
| 124 | ||
| 125 | 2 | if (!err) { |
| 126 | 1 | response.success = true; |
| 127 | } | |
| 128 | ||
| 129 | 2 | dispatch(SERVER_ACTION, Types.SAVE_PERMISSIONS_RESPONSE, response); |
| 130 | }); | |
| 131 | }, | |
| 132 | delete: function (data, router) { | |
| 133 | ||
| 134 | 3 | dispatch(VIEW_ACTION, Types.DELETE, data); |
| 135 | ||
| 136 | 3 | var id = data.id; |
| 137 | 3 | delete data.id; |
| 138 | ||
| 139 | 3 | var request = { |
| 140 | method: 'DELETE', | |
| 141 | url: '/api/admin-groups/' + id, | |
| 142 | data: data, | |
| 143 | useAuth: true | |
| 144 | }; | |
| 145 | ||
| 146 | 3 | Fetch(request, function (err, response) { |
| 147 | ||
| 148 | 3 | if (!err) { |
| 149 | 2 | response.success = true; |
| 150 | ||
| 151 | 2 | if (router) { |
| 152 | 1 | router.transitionTo('adminGroups'); |
| 153 | 1 | window.scrollTo(0, 0); |
| 154 | } | |
| 155 | } | |
| 156 | ||
| 157 | 3 | dispatch(SERVER_ACTION, Types.DELETE_RESPONSE, response); |
| 158 | }); | |
| 159 | } | |
| 160 | }; | |
| 161 | ||
| 162 | ||
| 163 | 1 | module.exports = Actions; |
| 164 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('../constants/Status'); |
| 4 | 1 | var Fetch = require('../../../helpers/jsonFetch'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 8 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 9 | 1 | var Types = Constants.ActionTypes; |
| 10 | 1 | var dispatch = Dispatcher.handleAction; |
| 11 | ||
| 12 | ||
| 13 | 1 | var Actions = { |
| 14 | getResults: function (data) { | |
| 15 | ||
| 16 | 3 | dispatch(VIEW_ACTION, Types.GET_RESULTS, data); |
| 17 | ||
| 18 | 3 | var request = { |
| 19 | method: 'GET', | |
| 20 | url: '/api/statuses', | |
| 21 | query: data, | |
| 22 | useAuth: true | |
| 23 | }; | |
| 24 | ||
| 25 | 3 | Fetch(request, function (err, response) { |
| 26 | ||
| 27 | 3 | if (!err) { |
| 28 | 2 | response.success = true; |
| 29 | } | |
| 30 | ||
| 31 | 3 | dispatch(SERVER_ACTION, Types.GET_RESULTS_RESPONSE, response); |
| 32 | }); | |
| 33 | }, | |
| 34 | getDetails: function (data) { | |
| 35 | ||
| 36 | 2 | dispatch(VIEW_ACTION, Types.GET_DETAILS, data); |
| 37 | ||
| 38 | 2 | var request = { |
| 39 | method: 'GET', | |
| 40 | url: '/api/statuses/' + data.id, | |
| 41 | useAuth: true | |
| 42 | }; | |
| 43 | ||
| 44 | 2 | Fetch(request, function (err, response) { |
| 45 | ||
| 46 | 2 | if (err) { |
| 47 | 1 | response.fetchFailure = true; |
| 48 | 1 | response.error = err.message; |
| 49 | } | |
| 50 | ||
| 51 | 2 | dispatch(SERVER_ACTION, Types.GET_DETAILS_RESPONSE, response); |
| 52 | }); | |
| 53 | }, | |
| 54 | showCreateNew: function (data) { | |
| 55 | ||
| 56 | 2 | dispatch(VIEW_ACTION, Types.SHOW_CREATE_NEW, data); |
| 57 | }, | |
| 58 | hideCreateNew: function (data) { | |
| 59 | ||
| 60 | 1 | dispatch(VIEW_ACTION, Types.HIDE_CREATE_NEW, data); |
| 61 | }, | |
| 62 | createNew: function (data, router) { | |
| 63 | ||
| 64 | 3 | dispatch(VIEW_ACTION, Types.CREATE_NEW, data); |
| 65 | ||
| 66 | 3 | var request = { |
| 67 | method: 'POST', | |
| 68 | url: '/api/statuses', | |
| 69 | data: data, | |
| 70 | useAuth: true | |
| 71 | }; | |
| 72 | ||
| 73 | 3 | Fetch(request, function (err, response) { |
| 74 | ||
| 75 | 3 | if (!err) { |
| 76 | 2 | response.success = true; |
| 77 | ||
| 78 | 2 | if (router) { |
| 79 | 1 | Actions.getResults(router.getCurrentQuery()); |
| 80 | } | |
| 81 | } | |
| 82 | ||
| 83 | 3 | dispatch(SERVER_ACTION, Types.CREATE_NEW_RESPONSE, response); |
| 84 | }); | |
| 85 | }, | |
| 86 | saveDetails: function (data) { | |
| 87 | ||
| 88 | 2 | dispatch(VIEW_ACTION, Types.SAVE_DETAILS, data); |
| 89 | ||
| 90 | 2 | var id = data.id; |
| 91 | 2 | delete data.id; |
| 92 | ||
| 93 | 2 | var request = { |
| 94 | method: 'PUT', | |
| 95 | url: '/api/statuses/' + id, | |
| 96 | data: data, | |
| 97 | useAuth: true | |
| 98 | }; | |
| 99 | ||
| 100 | 2 | Fetch(request, function (err, response) { |
| 101 | ||
| 102 | 2 | if (!err) { |
| 103 | 1 | response.success = true; |
| 104 | } | |
| 105 | ||
| 106 | 2 | dispatch(SERVER_ACTION, Types.SAVE_DETAILS_RESPONSE, response); |
| 107 | }); | |
| 108 | }, | |
| 109 | delete: function (data, router) { | |
| 110 | ||
| 111 | 3 | dispatch(VIEW_ACTION, Types.DELETE, data); |
| 112 | ||
| 113 | 3 | var id = data.id; |
| 114 | 3 | delete data.id; |
| 115 | ||
| 116 | 3 | var request = { |
| 117 | method: 'DELETE', | |
| 118 | url: '/api/statuses/' + id, | |
| 119 | data: data, | |
| 120 | useAuth: true | |
| 121 | }; | |
| 122 | ||
| 123 | 3 | Fetch(request, function (err, response) { |
| 124 | ||
| 125 | 3 | if (!err) { |
| 126 | 2 | response.success = true; |
| 127 | ||
| 128 | 2 | if (router) { |
| 129 | 1 | router.transitionTo('statuses'); |
| 130 | 1 | window.scrollTo(0, 0); |
| 131 | } | |
| 132 | } | |
| 133 | ||
| 134 | 3 | dispatch(SERVER_ACTION, Types.DELETE_RESPONSE, response); |
| 135 | }); | |
| 136 | } | |
| 137 | }; | |
| 138 | ||
| 139 | ||
| 140 | 1 | module.exports = Actions; |
| 141 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('../constants/User'); |
| 4 | 1 | var Fetch = require('../../../helpers/jsonFetch'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 8 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 9 | 1 | var Types = Constants.ActionTypes; |
| 10 | 1 | var dispatch = Dispatcher.handleAction; |
| 11 | ||
| 12 | ||
| 13 | 1 | var Actions = { |
| 14 | getResults: function (data) { | |
| 15 | ||
| 16 | 2 | dispatch(VIEW_ACTION, Types.GET_RESULTS, data); |
| 17 | ||
| 18 | 2 | var request = { |
| 19 | method: 'GET', | |
| 20 | url: '/api/users', | |
| 21 | query: data, | |
| 22 | useAuth: true | |
| 23 | }; | |
| 24 | ||
| 25 | 2 | Fetch(request, function (err, response) { |
| 26 | ||
| 27 | 2 | if (!err) { |
| 28 | 1 | response.success = true; |
| 29 | } | |
| 30 | ||
| 31 | 2 | dispatch(SERVER_ACTION, Types.GET_RESULTS_RESPONSE, response); |
| 32 | }); | |
| 33 | }, | |
| 34 | getIdentity: function (data) { | |
| 35 | ||
| 36 | 2 | dispatch(VIEW_ACTION, Types.GET_IDENTITY, data); |
| 37 | ||
| 38 | 2 | var request = { |
| 39 | method: 'GET', | |
| 40 | url: '/api/users/' + data.id, | |
| 41 | useAuth: true | |
| 42 | }; | |
| 43 | ||
| 44 | 2 | Fetch(request, function (err, response) { |
| 45 | ||
| 46 | 2 | if (err) { |
| 47 | 1 | response.fetchFailure = true; |
| 48 | 1 | response.error = err.message; |
| 49 | } | |
| 50 | ||
| 51 | 2 | dispatch(SERVER_ACTION, Types.GET_IDENTITY_RESPONSE, response); |
| 52 | }); | |
| 53 | }, | |
| 54 | showCreateNew: function (data) { | |
| 55 | ||
| 56 | 2 | dispatch(VIEW_ACTION, Types.SHOW_CREATE_NEW, data); |
| 57 | }, | |
| 58 | hideCreateNew: function (data) { | |
| 59 | ||
| 60 | 1 | dispatch(VIEW_ACTION, Types.HIDE_CREATE_NEW, data); |
| 61 | }, | |
| 62 | createNew: function (data, router) { | |
| 63 | ||
| 64 | 3 | dispatch(VIEW_ACTION, Types.CREATE_NEW, data); |
| 65 | ||
| 66 | 3 | var request = { |
| 67 | method: 'POST', | |
| 68 | url: '/api/users', | |
| 69 | data: data, | |
| 70 | useAuth: true | |
| 71 | }; | |
| 72 | ||
| 73 | 3 | Fetch(request, function (err, response) { |
| 74 | ||
| 75 | 3 | if (!err) { |
| 76 | 2 | response.success = true; |
| 77 | ||
| 78 | 2 | if (router) { |
| 79 | 1 | router.transitionTo('userDetails', { id: response._id }); |
| 80 | 1 | window.scrollTo(0, 0); |
| 81 | } | |
| 82 | } | |
| 83 | ||
| 84 | 3 | dispatch(SERVER_ACTION, Types.CREATE_NEW_RESPONSE, response); |
| 85 | }); | |
| 86 | }, | |
| 87 | saveIdentity: function (data) { | |
| 88 | ||
| 89 | 2 | dispatch(VIEW_ACTION, Types.SAVE_IDENTITY, data); |
| 90 | ||
| 91 | 2 | var id = data.id; |
| 92 | 2 | delete data.id; |
| 93 | ||
| 94 | 2 | var request = { |
| 95 | method: 'PUT', | |
| 96 | url: '/api/users/' + id, | |
| 97 | data: data, | |
| 98 | useAuth: true | |
| 99 | }; | |
| 100 | ||
| 101 | 2 | Fetch(request, function (err, response) { |
| 102 | ||
| 103 | 2 | if (!err) { |
| 104 | 1 | response.success = true; |
| 105 | } | |
| 106 | ||
| 107 | 2 | dispatch(SERVER_ACTION, Types.SAVE_IDENTITY_RESPONSE, response); |
| 108 | }); | |
| 109 | }, | |
| 110 | savePassword: function (data) { | |
| 111 | ||
| 112 | 3 | dispatch(VIEW_ACTION, Types.SAVE_PASSWORD, data); |
| 113 | ||
| 114 | 3 | if (data.password !== data.passwordConfirm) { |
| 115 | 1 | dispatch(VIEW_ACTION, Types.SAVE_PASSWORD_RESPONSE, { |
| 116 | message: 'Passwords do not match.' | |
| 117 | }); | |
| 118 | ||
| 119 | 1 | return; |
| 120 | } | |
| 121 | ||
| 122 | 2 | var id = data.id; |
| 123 | 2 | delete data.id; |
| 124 | 2 | delete data.passwordConfirm; |
| 125 | ||
| 126 | 2 | var request = { |
| 127 | method: 'PUT', | |
| 128 | url: '/api/users/' + id + '/password', | |
| 129 | data: data, | |
| 130 | useAuth: true | |
| 131 | }; | |
| 132 | ||
| 133 | 2 | Fetch(request, function (err, response) { |
| 134 | ||
| 135 | 2 | if (!err) { |
| 136 | 1 | response.success = true; |
| 137 | } | |
| 138 | ||
| 139 | 2 | dispatch(SERVER_ACTION, Types.SAVE_PASSWORD_RESPONSE, response); |
| 140 | }); | |
| 141 | }, | |
| 142 | delete: function (data, router) { | |
| 143 | ||
| 144 | 3 | dispatch(VIEW_ACTION, Types.DELETE, data); |
| 145 | ||
| 146 | 3 | var id = data.id; |
| 147 | 3 | delete data.id; |
| 148 | ||
| 149 | 3 | var request = { |
| 150 | method: 'DELETE', | |
| 151 | url: '/api/users/' + id, | |
| 152 | data: data, | |
| 153 | useAuth: true | |
| 154 | }; | |
| 155 | ||
| 156 | 3 | Fetch(request, function (err, response) { |
| 157 | ||
| 158 | 3 | if (!err) { |
| 159 | 2 | response.success = true; |
| 160 | ||
| 161 | 2 | if (router) { |
| 162 | 1 | router.transitionTo('users'); |
| 163 | 1 | window.scrollTo(0, 0); |
| 164 | } | |
| 165 | } | |
| 166 | ||
| 167 | 3 | dispatch(SERVER_ACTION, Types.DELETE_RESPONSE, response); |
| 168 | }); | |
| 169 | } | |
| 170 | }; | |
| 171 | ||
| 172 | ||
| 173 | 1 | module.exports = Actions; |
| 174 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/App.jsx | 1 | |
| 2 | client/pages/admin/components/App.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/App.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/App.jsx | 2 |
| 5 | 1 | var NavBar = require('./NavBar'); | client/pages/admin/components/App.jsx | 3 |
| 6 | 1 | var Footer = require('./Footer'); | client/pages/admin/components/App.jsx | 4 |
| 7 | client/pages/admin/components/App.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/App.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/App.jsx | 7 | |
| 10 | client/pages/admin/components/App.jsx | 7 | ||
| 11 | render: function render() { | client/pages/admin/components/App.jsx | 8 | |
| 12 | client/pages/admin/components/App.jsx | 8 | ||
| 13 | 2 | return React.createElement( | client/pages/admin/components/App.jsx | 10 |
| 14 | 'div', | client/pages/admin/components/App.jsx | 11 | |
| 15 | null, | client/pages/admin/components/App.jsx | 11 | |
| 16 | React.createElement(NavBar, null), | client/pages/admin/components/App.jsx | 11 | |
| 17 | React.createElement(ReactRouter.RouteHandler, null), | client/pages/admin/components/App.jsx | 12 | |
| 18 | React.createElement(Footer, null) | client/pages/admin/components/App.jsx | 13 | |
| 19 | ); | client/pages/admin/components/App.jsx | 14 | |
| 20 | } | client/pages/admin/components/App.jsx | 16 | |
| 21 | }); | client/pages/admin/components/App.jsx | 17 | |
| 22 | client/pages/admin/components/App.jsx | 18 | ||
| 23 | 1 | module.exports = Component; | client/pages/admin/components/App.jsx | 21 |
| 24 | client/pages/admin/components/App.jsx | 21 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | "use strict"; | client/pages/admin/components/Footer.jsx | 1 | |
| 2 | client/pages/admin/components/Footer.jsx | 2 | ||
| 3 | 1 | var React = require("react/addons"); | client/pages/admin/components/Footer.jsx | 1 |
| 4 | client/pages/admin/components/Footer.jsx | 1 | ||
| 5 | 1 | var Component = React.createClass({ | client/pages/admin/components/Footer.jsx | 4 |
| 6 | displayName: "Component", | client/pages/admin/components/Footer.jsx | 4 | |
| 7 | client/pages/admin/components/Footer.jsx | 4 | ||
| 8 | render: function render() { | client/pages/admin/components/Footer.jsx | 5 | |
| 9 | client/pages/admin/components/Footer.jsx | 5 | ||
| 10 | 3 | return React.createElement( | client/pages/admin/components/Footer.jsx | 7 |
| 11 | "div", | client/pages/admin/components/Footer.jsx | 8 | |
| 12 | { className: "footer" }, | client/pages/admin/components/Footer.jsx | 8 | |
| 13 | React.createElement( | client/pages/admin/components/Footer.jsx | 8 | |
| 14 | "div", | client/pages/admin/components/Footer.jsx | 9 | |
| 15 | { className: "container" }, | client/pages/admin/components/Footer.jsx | 9 | |
| 16 | React.createElement( | client/pages/admin/components/Footer.jsx | 9 | |
| 17 | "span", | client/pages/admin/components/Footer.jsx | 10 | |
| 18 | { className: "copyright pull-right" }, | client/pages/admin/components/Footer.jsx | 10 | |
| 19 | "© 2014 Acme, Inc." | client/pages/admin/components/Footer.jsx | 10 | |
| 20 | ), | client/pages/admin/components/Footer.jsx | 10 | |
| 21 | React.createElement( | client/pages/admin/components/Footer.jsx | 12 | |
| 22 | "ul", | client/pages/admin/components/Footer.jsx | 13 | |
| 23 | { className: "links" }, | client/pages/admin/components/Footer.jsx | 13 | |
| 24 | React.createElement( | client/pages/admin/components/Footer.jsx | 13 | |
| 25 | "li", | client/pages/admin/components/Footer.jsx | 14 | |
| 26 | null, | client/pages/admin/components/Footer.jsx | 14 | |
| 27 | React.createElement( | client/pages/admin/components/Footer.jsx | 14 | |
| 28 | "a", | client/pages/admin/components/Footer.jsx | 14 | |
| 29 | { href: "/" }, | client/pages/admin/components/Footer.jsx | 14 | |
| 30 | "Home" | client/pages/admin/components/Footer.jsx | 14 | |
| 31 | ) | client/pages/admin/components/Footer.jsx | 14 | |
| 32 | ), | client/pages/admin/components/Footer.jsx | 14 | |
| 33 | React.createElement( | client/pages/admin/components/Footer.jsx | 14 | |
| 34 | "li", | client/pages/admin/components/Footer.jsx | 15 | |
| 35 | null, | client/pages/admin/components/Footer.jsx | 15 | |
| 36 | React.createElement( | client/pages/admin/components/Footer.jsx | 15 | |
| 37 | "a", | client/pages/admin/components/Footer.jsx | 15 | |
| 38 | { href: "/login/logout" }, | client/pages/admin/components/Footer.jsx | 15 | |
| 39 | "Sign out" | client/pages/admin/components/Footer.jsx | 15 | |
| 40 | ) | client/pages/admin/components/Footer.jsx | 15 | |
| 41 | ) | client/pages/admin/components/Footer.jsx | 15 | |
| 42 | ) | client/pages/admin/components/Footer.jsx | 15 | |
| 43 | ) | client/pages/admin/components/Footer.jsx | 16 | |
| 44 | ); | client/pages/admin/components/Footer.jsx | 17 | |
| 45 | } | client/pages/admin/components/Footer.jsx | 19 | |
| 46 | }); | client/pages/admin/components/Footer.jsx | 20 | |
| 47 | client/pages/admin/components/Footer.jsx | 21 | ||
| 48 | 1 | module.exports = Component; | client/pages/admin/components/Footer.jsx | 24 |
| 49 | client/pages/admin/components/Footer.jsx | 24 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/NavBar.jsx | 1 | |
| 2 | client/pages/admin/components/NavBar.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/NavBar.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/NavBar.jsx | 2 |
| 5 | 1 | var ClassNames = require('classnames'); | client/pages/admin/components/NavBar.jsx | 3 |
| 6 | client/pages/admin/components/NavBar.jsx | 3 | ||
| 7 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/NavBar.jsx | 6 |
| 8 | client/pages/admin/components/NavBar.jsx | 6 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/NavBar.jsx | 9 |
| 10 | displayName: 'Component', | client/pages/admin/components/NavBar.jsx | 9 | |
| 11 | client/pages/admin/components/NavBar.jsx | 9 | ||
| 12 | contextTypes: { | client/pages/admin/components/NavBar.jsx | 10 | |
| 13 | router: React.PropTypes.func | client/pages/admin/components/NavBar.jsx | 11 | |
| 14 | }, | client/pages/admin/components/NavBar.jsx | 11 | |
| 15 | getInitialState: function getInitialState() { | client/pages/admin/components/NavBar.jsx | 13 | |
| 16 | client/pages/admin/components/NavBar.jsx | 13 | ||
| 17 | 5 | return { | client/pages/admin/components/NavBar.jsx | 15 |
| 18 | navBarOpen: false | client/pages/admin/components/NavBar.jsx | 16 | |
| 19 | }; | client/pages/admin/components/NavBar.jsx | 16 | |
| 20 | }, | client/pages/admin/components/NavBar.jsx | 17 | |
| 21 | componentWillReceiveProps: function componentWillReceiveProps() { | client/pages/admin/components/NavBar.jsx | 19 | |
| 22 | client/pages/admin/components/NavBar.jsx | 19 | ||
| 23 | 1 | this.setState({ navBarOpen: false }); | client/pages/admin/components/NavBar.jsx | 21 |
| 24 | }, | client/pages/admin/components/NavBar.jsx | 21 | |
| 25 | isNavActive: function isNavActive(routes) { | client/pages/admin/components/NavBar.jsx | 23 | |
| 26 | client/pages/admin/components/NavBar.jsx | 23 | ||
| 27 | 35 | return ClassNames({ | client/pages/admin/components/NavBar.jsx | 25 |
| 28 | active: routes.some((function (route) { | client/pages/admin/components/NavBar.jsx | 26 | |
| 29 | client/pages/admin/components/NavBar.jsx | 26 | ||
| 30 | 70 | return this.context.router.isActive(route); | client/pages/admin/components/NavBar.jsx | 28 |
| 31 | }).bind(this)) | client/pages/admin/components/NavBar.jsx | 28 | |
| 32 | }); | client/pages/admin/components/NavBar.jsx | 29 | |
| 33 | }, | client/pages/admin/components/NavBar.jsx | 30 | |
| 34 | toggleMenu: function toggleMenu() { | client/pages/admin/components/NavBar.jsx | 32 | |
| 35 | client/pages/admin/components/NavBar.jsx | 32 | ||
| 36 | 1 | this.setState({ navBarOpen: !this.state.navBarOpen }); | client/pages/admin/components/NavBar.jsx | 34 |
| 37 | }, | client/pages/admin/components/NavBar.jsx | 34 | |
| 38 | render: function render() { | client/pages/admin/components/NavBar.jsx | 36 | |
| 39 | client/pages/admin/components/NavBar.jsx | 36 | ||
| 40 | 7 | var navBarCollapse = ClassNames({ | client/pages/admin/components/NavBar.jsx | 38 |
| 41 | 'navbar-collapse': true, | client/pages/admin/components/NavBar.jsx | 39 | |
| 42 | collapse: !this.state.navBarOpen | client/pages/admin/components/NavBar.jsx | 40 | |
| 43 | }); | client/pages/admin/components/NavBar.jsx | 40 | |
| 44 | client/pages/admin/components/NavBar.jsx | 41 | ||
| 45 | 7 | return React.createElement( | client/pages/admin/components/NavBar.jsx | 43 |
| 46 | 'div', | client/pages/admin/components/NavBar.jsx | 44 | |
| 47 | { className: 'navbar navbar-inverse navbar-fixed-top' }, | client/pages/admin/components/NavBar.jsx | 44 | |
| 48 | React.createElement( | client/pages/admin/components/NavBar.jsx | 44 | |
| 49 | 'div', | client/pages/admin/components/NavBar.jsx | 45 | |
| 50 | { className: 'container' }, | client/pages/admin/components/NavBar.jsx | 45 | |
| 51 | React.createElement( | client/pages/admin/components/NavBar.jsx | 45 | |
| 52 | 'div', | client/pages/admin/components/NavBar.jsx | 46 | |
| 53 | { className: 'navbar-header' }, | client/pages/admin/components/NavBar.jsx | 46 | |
| 54 | React.createElement( | client/pages/admin/components/NavBar.jsx | 46 | |
| 55 | Link, | client/pages/admin/components/NavBar.jsx | 47 | |
| 56 | { className: 'navbar-brand', to: 'home' }, | client/pages/admin/components/NavBar.jsx | 47 | |
| 57 | React.createElement('img', { | client/pages/admin/components/NavBar.jsx | 47 | |
| 58 | className: 'navbar-logo', | client/pages/admin/components/NavBar.jsx | 49 | |
| 59 | src: '/public/media/logo-square-inverse.png' | client/pages/admin/components/NavBar.jsx | 50 | |
| 60 | }), | client/pages/admin/components/NavBar.jsx | 50 | |
| 61 | React.createElement( | client/pages/admin/components/NavBar.jsx | 51 | |
| 62 | 'span', | client/pages/admin/components/NavBar.jsx | 52 | |
| 63 | { className: 'navbar-brand-label' }, | client/pages/admin/components/NavBar.jsx | 52 | |
| 64 | 'Aqua' | client/pages/admin/components/NavBar.jsx | 52 | |
| 65 | ) | client/pages/admin/components/NavBar.jsx | 52 | |
| 66 | ), | client/pages/admin/components/NavBar.jsx | 52 | |
| 67 | React.createElement( | client/pages/admin/components/NavBar.jsx | 53 | |
| 68 | 'button', | client/pages/admin/components/NavBar.jsx | 54 | |
| 69 | { | client/pages/admin/components/NavBar.jsx | 54 | |
| 70 | className: 'navbar-toggle collapsed', | client/pages/admin/components/NavBar.jsx | 55 | |
| 71 | onClick: this.toggleMenu }, | client/pages/admin/components/NavBar.jsx | 56 | |
| 72 | React.createElement('span', { className: 'icon-bar' }), | client/pages/admin/components/NavBar.jsx | 56 | |
| 73 | React.createElement('span', { className: 'icon-bar' }), | client/pages/admin/components/NavBar.jsx | 58 | |
| 74 | React.createElement('span', { className: 'icon-bar' }) | client/pages/admin/components/NavBar.jsx | 59 | |
| 75 | ) | client/pages/admin/components/NavBar.jsx | 60 | |
| 76 | ), | client/pages/admin/components/NavBar.jsx | 61 | |
| 77 | React.createElement( | client/pages/admin/components/NavBar.jsx | 62 | |
| 78 | 'div', | client/pages/admin/components/NavBar.jsx | 63 | |
| 79 | { className: navBarCollapse }, | client/pages/admin/components/NavBar.jsx | 63 | |
| 80 | React.createElement( | client/pages/admin/components/NavBar.jsx | 63 | |
| 81 | 'ul', | client/pages/admin/components/NavBar.jsx | 64 | |
| 82 | { className: 'nav navbar-nav' }, | client/pages/admin/components/NavBar.jsx | 64 | |
| 83 | React.createElement( | client/pages/admin/components/NavBar.jsx | 64 | |
| 84 | 'li', | client/pages/admin/components/NavBar.jsx | 65 | |
| 85 | { className: this.isNavActive(['accounts', 'accountDetails']) }, | client/pages/admin/components/NavBar.jsx | 65 | |
| 86 | React.createElement( | client/pages/admin/components/NavBar.jsx | 65 | |
| 87 | Link, | client/pages/admin/components/NavBar.jsx | 66 | |
| 88 | { to: 'accounts' }, | client/pages/admin/components/NavBar.jsx | 66 | |
| 89 | 'Accounts' | client/pages/admin/components/NavBar.jsx | 66 | |
| 90 | ) | client/pages/admin/components/NavBar.jsx | 66 | |
| 91 | ), | client/pages/admin/components/NavBar.jsx | 66 | |
| 92 | React.createElement( | client/pages/admin/components/NavBar.jsx | 67 | |
| 93 | 'li', | client/pages/admin/components/NavBar.jsx | 68 | |
| 94 | { className: this.isNavActive(['admins', 'adminDetails']) }, | client/pages/admin/components/NavBar.jsx | 68 | |
| 95 | React.createElement( | client/pages/admin/components/NavBar.jsx | 68 | |
| 96 | Link, | client/pages/admin/components/NavBar.jsx | 69 | |
| 97 | { to: 'admins' }, | client/pages/admin/components/NavBar.jsx | 69 | |
| 98 | 'Admins' | client/pages/admin/components/NavBar.jsx | 69 | |
| 99 | ) | client/pages/admin/components/NavBar.jsx | 69 | |
| 100 | ), | client/pages/admin/components/NavBar.jsx | 69 | |
| 101 | React.createElement( | client/pages/admin/components/NavBar.jsx | 70 | |
| 102 | 'li', | client/pages/admin/components/NavBar.jsx | 71 | |
| 103 | { className: this.isNavActive(['adminGroups', 'adminGroupDetails']) }, | client/pages/admin/components/NavBar.jsx | 71 | |
| 104 | React.createElement( | client/pages/admin/components/NavBar.jsx | 71 | |
| 105 | Link, | client/pages/admin/components/NavBar.jsx | 72 | |
| 106 | { to: 'adminGroups' }, | client/pages/admin/components/NavBar.jsx | 72 | |
| 107 | 'Admin Groups' | client/pages/admin/components/NavBar.jsx | 72 | |
| 108 | ) | client/pages/admin/components/NavBar.jsx | 72 | |
| 109 | ), | client/pages/admin/components/NavBar.jsx | 72 | |
| 110 | React.createElement( | client/pages/admin/components/NavBar.jsx | 73 | |
| 111 | 'li', | client/pages/admin/components/NavBar.jsx | 74 | |
| 112 | { className: this.isNavActive(['statuses', 'statusDetails']) }, | client/pages/admin/components/NavBar.jsx | 74 | |
| 113 | React.createElement( | client/pages/admin/components/NavBar.jsx | 74 | |
| 114 | Link, | client/pages/admin/components/NavBar.jsx | 75 | |
| 115 | { to: 'statuses' }, | client/pages/admin/components/NavBar.jsx | 75 | |
| 116 | 'Statuses' | client/pages/admin/components/NavBar.jsx | 75 | |
| 117 | ) | client/pages/admin/components/NavBar.jsx | 75 | |
| 118 | ), | client/pages/admin/components/NavBar.jsx | 75 | |
| 119 | React.createElement( | client/pages/admin/components/NavBar.jsx | 76 | |
| 120 | 'li', | client/pages/admin/components/NavBar.jsx | 77 | |
| 121 | { className: this.isNavActive(['users', 'userDetails']) }, | client/pages/admin/components/NavBar.jsx | 77 | |
| 122 | React.createElement( | client/pages/admin/components/NavBar.jsx | 77 | |
| 123 | Link, | client/pages/admin/components/NavBar.jsx | 78 | |
| 124 | { to: 'users' }, | client/pages/admin/components/NavBar.jsx | 78 | |
| 125 | 'Users' | client/pages/admin/components/NavBar.jsx | 78 | |
| 126 | ) | client/pages/admin/components/NavBar.jsx | 78 | |
| 127 | ) | client/pages/admin/components/NavBar.jsx | 78 | |
| 128 | ), | client/pages/admin/components/NavBar.jsx | 79 | |
| 129 | React.createElement( | client/pages/admin/components/NavBar.jsx | 80 | |
| 130 | 'ul', | client/pages/admin/components/NavBar.jsx | 81 | |
| 131 | { className: 'nav navbar-nav navbar-right' }, | client/pages/admin/components/NavBar.jsx | 81 | |
| 132 | React.createElement( | client/pages/admin/components/NavBar.jsx | 81 | |
| 133 | 'li', | client/pages/admin/components/NavBar.jsx | 82 | |
| 134 | null, | client/pages/admin/components/NavBar.jsx | 82 | |
| 135 | React.createElement( | client/pages/admin/components/NavBar.jsx | 82 | |
| 136 | 'a', | client/pages/admin/components/NavBar.jsx | 83 | |
| 137 | { href: '/login/logout' }, | client/pages/admin/components/NavBar.jsx | 83 | |
| 138 | 'Sign out' | client/pages/admin/components/NavBar.jsx | 83 | |
| 139 | ) | client/pages/admin/components/NavBar.jsx | 83 | |
| 140 | ) | client/pages/admin/components/NavBar.jsx | 83 | |
| 141 | ) | client/pages/admin/components/NavBar.jsx | 84 | |
| 142 | ) | client/pages/admin/components/NavBar.jsx | 85 | |
| 143 | ) | client/pages/admin/components/NavBar.jsx | 86 | |
| 144 | ); | client/pages/admin/components/NavBar.jsx | 87 | |
| 145 | } | client/pages/admin/components/NavBar.jsx | 89 | |
| 146 | }); | client/pages/admin/components/NavBar.jsx | 90 | |
| 147 | client/pages/admin/components/NavBar.jsx | 91 | ||
| 148 | 1 | module.exports = Component; | client/pages/admin/components/NavBar.jsx | 94 |
| 149 | client/pages/admin/components/NavBar.jsx | 94 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/accounts/CreateNewForm.jsx | 1 | |
| 2 | client/pages/admin/components/accounts/CreateNewForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/CreateNewForm.jsx | 1 |
| 4 | 1 | var Modal = require('../../../../components/Modal'); | client/pages/admin/components/accounts/CreateNewForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/accounts/CreateNewForm.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/accounts/CreateNewForm.jsx | 4 |
| 7 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/accounts/CreateNewForm.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/accounts/CreateNewForm.jsx | 6 |
| 9 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/CreateNewForm.jsx | 7 |
| 10 | client/pages/admin/components/accounts/CreateNewForm.jsx | 7 | ||
| 11 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/accounts/CreateNewForm.jsx | 10 |
| 12 | client/pages/admin/components/accounts/CreateNewForm.jsx | 10 | ||
| 13 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/CreateNewForm.jsx | 13 |
| 14 | displayName: 'Component', | client/pages/admin/components/accounts/CreateNewForm.jsx | 13 | |
| 15 | client/pages/admin/components/accounts/CreateNewForm.jsx | 13 | ||
| 16 | mixins: [LinkedState], | client/pages/admin/components/accounts/CreateNewForm.jsx | 14 | |
| 17 | contextTypes: { | client/pages/admin/components/accounts/CreateNewForm.jsx | 15 | |
| 18 | router: React.PropTypes.func | client/pages/admin/components/accounts/CreateNewForm.jsx | 16 | |
| 19 | }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 16 | |
| 20 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/accounts/CreateNewForm.jsx | 18 | |
| 21 | client/pages/admin/components/accounts/CreateNewForm.jsx | 18 | ||
| 22 | 1 | return { | client/pages/admin/components/accounts/CreateNewForm.jsx | 20 |
| 23 | data: { | client/pages/admin/components/accounts/CreateNewForm.jsx | 21 | |
| 24 | hasError: {}, | client/pages/admin/components/accounts/CreateNewForm.jsx | 22 | |
| 25 | help: {} | client/pages/admin/components/accounts/CreateNewForm.jsx | 23 | |
| 26 | } | client/pages/admin/components/accounts/CreateNewForm.jsx | 23 | |
| 27 | }; | client/pages/admin/components/accounts/CreateNewForm.jsx | 24 | |
| 28 | }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 25 | |
| 29 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/CreateNewForm.jsx | 27 | |
| 30 | client/pages/admin/components/accounts/CreateNewForm.jsx | 27 | ||
| 31 | 15 | return {}; | client/pages/admin/components/accounts/CreateNewForm.jsx | 29 |
| 32 | }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 29 | |
| 33 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/accounts/CreateNewForm.jsx | 31 | |
| 34 | client/pages/admin/components/accounts/CreateNewForm.jsx | 31 | ||
| 35 | 2 | clearTimeout(this.timeout); | client/pages/admin/components/accounts/CreateNewForm.jsx | 33 |
| 36 | }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 33 | |
| 37 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/accounts/CreateNewForm.jsx | 35 | |
| 38 | client/pages/admin/components/accounts/CreateNewForm.jsx | 35 | ||
| 39 | 9 | if (!nextProps.data.show) { | client/pages/admin/components/accounts/CreateNewForm.jsx | 37 |
| 40 | 8 | this.replaceState({}); | client/pages/admin/components/accounts/CreateNewForm.jsx | 38 |
| 41 | } else { | client/pages/admin/components/accounts/CreateNewForm.jsx | 38 | |
| 42 | 1 | this.timeout = setTimeout((function () { | client/pages/admin/components/accounts/CreateNewForm.jsx | 41 |
| 43 | client/pages/admin/components/accounts/CreateNewForm.jsx | 41 | ||
| 44 | 1 | this.refs.name.refs.inputField.getDOMNode().focus(); | client/pages/admin/components/accounts/CreateNewForm.jsx | 43 |
| 45 | }).bind(this), 100); | client/pages/admin/components/accounts/CreateNewForm.jsx | 43 | |
| 46 | } | client/pages/admin/components/accounts/CreateNewForm.jsx | 44 | |
| 47 | }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 45 | |
| 48 | onSubmit: function onSubmit(event) { | client/pages/admin/components/accounts/CreateNewForm.jsx | 47 | |
| 49 | client/pages/admin/components/accounts/CreateNewForm.jsx | 47 | ||
| 50 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/CreateNewForm.jsx | 49 |
| 51 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/CreateNewForm.jsx | 50 |
| 52 | client/pages/admin/components/accounts/CreateNewForm.jsx | 50 | ||
| 53 | 1 | Actions.createNew({ | client/pages/admin/components/accounts/CreateNewForm.jsx | 52 |
| 54 | name: this.state.name | client/pages/admin/components/accounts/CreateNewForm.jsx | 53 | |
| 55 | }, this.context.router); | client/pages/admin/components/accounts/CreateNewForm.jsx | 53 | |
| 56 | }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 54 | |
| 57 | render: function render() { | client/pages/admin/components/accounts/CreateNewForm.jsx | 56 | |
| 58 | client/pages/admin/components/accounts/CreateNewForm.jsx | 56 | ||
| 59 | 24 | var alerts; | client/pages/admin/components/accounts/CreateNewForm.jsx | 58 |
| 60 | 24 | if (this.props.data.error) { | client/pages/admin/components/accounts/CreateNewForm.jsx | 59 |
| 61 | 1 | alerts = React.createElement( | client/pages/admin/components/accounts/CreateNewForm.jsx | 60 |
| 62 | 'div', | client/pages/admin/components/accounts/CreateNewForm.jsx | 60 | |
| 63 | { className: 'alert alert-danger' }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 60 | |
| 64 | this.props.data.error | client/pages/admin/components/accounts/CreateNewForm.jsx | 60 | |
| 65 | ); | client/pages/admin/components/accounts/CreateNewForm.jsx | 61 | |
| 66 | } | client/pages/admin/components/accounts/CreateNewForm.jsx | 62 | |
| 67 | client/pages/admin/components/accounts/CreateNewForm.jsx | 63 | ||
| 68 | 24 | var notice; | client/pages/admin/components/accounts/CreateNewForm.jsx | 65 |
| 69 | 24 | if (this.props.data.success) { | client/pages/admin/components/accounts/CreateNewForm.jsx | 66 |
| 70 | 1 | notice = React.createElement( | client/pages/admin/components/accounts/CreateNewForm.jsx | 67 |
| 71 | 'div', | client/pages/admin/components/accounts/CreateNewForm.jsx | 67 | |
| 72 | { className: 'alert alert-success' }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 67 | |
| 73 | 'Loading data...' | client/pages/admin/components/accounts/CreateNewForm.jsx | 67 | |
| 74 | ); | client/pages/admin/components/accounts/CreateNewForm.jsx | 67 | |
| 75 | } | client/pages/admin/components/accounts/CreateNewForm.jsx | 69 | |
| 76 | client/pages/admin/components/accounts/CreateNewForm.jsx | 70 | ||
| 77 | 24 | var formElements; | client/pages/admin/components/accounts/CreateNewForm.jsx | 72 |
| 78 | 24 | if (!this.props.data.success) { | client/pages/admin/components/accounts/CreateNewForm.jsx | 73 |
| 79 | 23 | formElements = React.createElement( | client/pages/admin/components/accounts/CreateNewForm.jsx | 74 |
| 80 | 'fieldset', | client/pages/admin/components/accounts/CreateNewForm.jsx | 74 | |
| 81 | null, | client/pages/admin/components/accounts/CreateNewForm.jsx | 74 | |
| 82 | alerts, | client/pages/admin/components/accounts/CreateNewForm.jsx | 74 | |
| 83 | React.createElement(TextControl, { | client/pages/admin/components/accounts/CreateNewForm.jsx | 75 | |
| 84 | name: 'name', | client/pages/admin/components/accounts/CreateNewForm.jsx | 77 | |
| 85 | ref: 'name', | client/pages/admin/components/accounts/CreateNewForm.jsx | 78 | |
| 86 | label: 'Name', | client/pages/admin/components/accounts/CreateNewForm.jsx | 79 | |
| 87 | hasError: this.props.data.hasError.name, | client/pages/admin/components/accounts/CreateNewForm.jsx | 80 | |
| 88 | valueLink: this.linkState('name'), | client/pages/admin/components/accounts/CreateNewForm.jsx | 81 | |
| 89 | help: this.props.data.help.name, | client/pages/admin/components/accounts/CreateNewForm.jsx | 82 | |
| 90 | disabled: this.props.data.loading | client/pages/admin/components/accounts/CreateNewForm.jsx | 83 | |
| 91 | }), | client/pages/admin/components/accounts/CreateNewForm.jsx | 83 | |
| 92 | React.createElement( | client/pages/admin/components/accounts/CreateNewForm.jsx | 84 | |
| 93 | ControlGroup, | client/pages/admin/components/accounts/CreateNewForm.jsx | 85 | |
| 94 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 85 | |
| 95 | React.createElement( | client/pages/admin/components/accounts/CreateNewForm.jsx | 85 | |
| 96 | Button, | client/pages/admin/components/accounts/CreateNewForm.jsx | 86 | |
| 97 | { | client/pages/admin/components/accounts/CreateNewForm.jsx | 86 | |
| 98 | type: 'submit', | client/pages/admin/components/accounts/CreateNewForm.jsx | 87 | |
| 99 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 88 | |
| 100 | disabled: this.props.data.loading }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 89 | |
| 101 | 'Create new', | client/pages/admin/components/accounts/CreateNewForm.jsx | 89 | |
| 102 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/accounts/CreateNewForm.jsx | 89 | |
| 103 | ) | client/pages/admin/components/accounts/CreateNewForm.jsx | 92 | |
| 104 | ) | client/pages/admin/components/accounts/CreateNewForm.jsx | 93 | |
| 105 | ); | client/pages/admin/components/accounts/CreateNewForm.jsx | 94 | |
| 106 | } | client/pages/admin/components/accounts/CreateNewForm.jsx | 95 | |
| 107 | client/pages/admin/components/accounts/CreateNewForm.jsx | 96 | ||
| 108 | 24 | return React.createElement( | client/pages/admin/components/accounts/CreateNewForm.jsx | 98 |
| 109 | Modal, | client/pages/admin/components/accounts/CreateNewForm.jsx | 99 | |
| 110 | { | client/pages/admin/components/accounts/CreateNewForm.jsx | 99 | |
| 111 | header: 'Create new', | client/pages/admin/components/accounts/CreateNewForm.jsx | 100 | |
| 112 | show: this.props.data.show, | client/pages/admin/components/accounts/CreateNewForm.jsx | 101 | |
| 113 | onClose: Actions.hideCreateNew }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 102 | |
| 114 | React.createElement( | client/pages/admin/components/accounts/CreateNewForm.jsx | 102 | |
| 115 | 'form', | client/pages/admin/components/accounts/CreateNewForm.jsx | 104 | |
| 116 | { onSubmit: this.onSubmit }, | client/pages/admin/components/accounts/CreateNewForm.jsx | 104 | |
| 117 | notice, | client/pages/admin/components/accounts/CreateNewForm.jsx | 104 | |
| 118 | formElements | client/pages/admin/components/accounts/CreateNewForm.jsx | 105 | |
| 119 | ) | client/pages/admin/components/accounts/CreateNewForm.jsx | 106 | |
| 120 | ); | client/pages/admin/components/accounts/CreateNewForm.jsx | 107 | |
| 121 | } | client/pages/admin/components/accounts/CreateNewForm.jsx | 109 | |
| 122 | }); | client/pages/admin/components/accounts/CreateNewForm.jsx | 110 | |
| 123 | client/pages/admin/components/accounts/CreateNewForm.jsx | 111 | ||
| 124 | 1 | module.exports = Component; | client/pages/admin/components/accounts/CreateNewForm.jsx | 114 |
| 125 | client/pages/admin/components/accounts/CreateNewForm.jsx | 114 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/accounts/DeleteForm.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/accounts/DeleteForm.jsx | 2 | |
| 3 | client/pages/admin/components/accounts/DeleteForm.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/DeleteForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/accounts/DeleteForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/accounts/DeleteForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/accounts/DeleteForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/DeleteForm.jsx | 6 |
| 9 | client/pages/admin/components/accounts/DeleteForm.jsx | 6 | ||
| 10 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/accounts/DeleteForm.jsx | 9 |
| 11 | client/pages/admin/components/accounts/DeleteForm.jsx | 9 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/DeleteForm.jsx | 12 |
| 13 | displayName: 'Component', | client/pages/admin/components/accounts/DeleteForm.jsx | 12 | |
| 14 | client/pages/admin/components/accounts/DeleteForm.jsx | 12 | ||
| 15 | mixins: [LinkedState], | client/pages/admin/components/accounts/DeleteForm.jsx | 13 | |
| 16 | contextTypes: { | client/pages/admin/components/accounts/DeleteForm.jsx | 14 | |
| 17 | router: React.PropTypes.func | client/pages/admin/components/accounts/DeleteForm.jsx | 15 | |
| 18 | }, | client/pages/admin/components/accounts/DeleteForm.jsx | 15 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/DeleteForm.jsx | 17 | |
| 20 | client/pages/admin/components/accounts/DeleteForm.jsx | 17 | ||
| 21 | 10 | return {}; | client/pages/admin/components/accounts/DeleteForm.jsx | 19 |
| 22 | }, | client/pages/admin/components/accounts/DeleteForm.jsx | 19 | |
| 23 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/accounts/DeleteForm.jsx | 21 | |
| 24 | client/pages/admin/components/accounts/DeleteForm.jsx | 21 | ||
| 25 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/DeleteForm.jsx | 23 |
| 26 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/DeleteForm.jsx | 24 |
| 27 | client/pages/admin/components/accounts/DeleteForm.jsx | 24 | ||
| 28 | 1 | Actions['delete']({ | client/pages/admin/components/accounts/DeleteForm.jsx | 26 |
| 29 | id: this.props.details._id | client/pages/admin/components/accounts/DeleteForm.jsx | 27 | |
| 30 | }, this.context.router); | client/pages/admin/components/accounts/DeleteForm.jsx | 27 | |
| 31 | }, | client/pages/admin/components/accounts/DeleteForm.jsx | 28 | |
| 32 | onConfirm: function onConfirm(event) { | client/pages/admin/components/accounts/DeleteForm.jsx | 30 | |
| 33 | client/pages/admin/components/accounts/DeleteForm.jsx | 30 | ||
| 34 | 2 | if (!window.confirm('Are you sure?')) { | client/pages/admin/components/accounts/DeleteForm.jsx | 32 |
| 35 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/DeleteForm.jsx | 33 |
| 36 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/DeleteForm.jsx | 34 |
| 37 | } | client/pages/admin/components/accounts/DeleteForm.jsx | 34 | |
| 38 | }, | client/pages/admin/components/accounts/DeleteForm.jsx | 35 | |
| 39 | render: function render() { | client/pages/admin/components/accounts/DeleteForm.jsx | 37 | |
| 40 | client/pages/admin/components/accounts/DeleteForm.jsx | 37 | ||
| 41 | 16 | var alerts; | client/pages/admin/components/accounts/DeleteForm.jsx | 39 |
| 42 | 16 | if (this.props.data.error) { | client/pages/admin/components/accounts/DeleteForm.jsx | 40 |
| 43 | 1 | alerts = React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 41 |
| 44 | 'div', | client/pages/admin/components/accounts/DeleteForm.jsx | 41 | |
| 45 | { className: 'alert alert-danger' }, | client/pages/admin/components/accounts/DeleteForm.jsx | 41 | |
| 46 | this.props.data.error | client/pages/admin/components/accounts/DeleteForm.jsx | 41 | |
| 47 | ); | client/pages/admin/components/accounts/DeleteForm.jsx | 42 | |
| 48 | } | client/pages/admin/components/accounts/DeleteForm.jsx | 43 | |
| 49 | client/pages/admin/components/accounts/DeleteForm.jsx | 44 | ||
| 50 | 16 | return React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 46 |
| 51 | 'form', | client/pages/admin/components/accounts/DeleteForm.jsx | 47 | |
| 52 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/accounts/DeleteForm.jsx | 47 | |
| 53 | React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 47 | |
| 54 | 'fieldset', | client/pages/admin/components/accounts/DeleteForm.jsx | 48 | |
| 55 | null, | client/pages/admin/components/accounts/DeleteForm.jsx | 48 | |
| 56 | React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 48 | |
| 57 | 'legend', | client/pages/admin/components/accounts/DeleteForm.jsx | 49 | |
| 58 | null, | client/pages/admin/components/accounts/DeleteForm.jsx | 49 | |
| 59 | 'Danger zone' | client/pages/admin/components/accounts/DeleteForm.jsx | 49 | |
| 60 | ), | client/pages/admin/components/accounts/DeleteForm.jsx | 49 | |
| 61 | React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 49 | |
| 62 | 'p', | client/pages/admin/components/accounts/DeleteForm.jsx | 50 | |
| 63 | null, | client/pages/admin/components/accounts/DeleteForm.jsx | 50 | |
| 64 | React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 50 | |
| 65 | 'span', | client/pages/admin/components/accounts/DeleteForm.jsx | 51 | |
| 66 | { className: 'label label-danger' }, | client/pages/admin/components/accounts/DeleteForm.jsx | 51 | |
| 67 | 'Warning' | client/pages/admin/components/accounts/DeleteForm.jsx | 51 | |
| 68 | ), | client/pages/admin/components/accounts/DeleteForm.jsx | 51 | |
| 69 | 'Â This cannot be undone and could result in orphaned document relationships.' | client/pages/admin/components/accounts/DeleteForm.jsx | 51 | |
| 70 | ), | client/pages/admin/components/accounts/DeleteForm.jsx | 51 | |
| 71 | alerts, | client/pages/admin/components/accounts/DeleteForm.jsx | 54 | |
| 72 | React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 55 | |
| 73 | ControlGroup, | client/pages/admin/components/accounts/DeleteForm.jsx | 56 | |
| 74 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/accounts/DeleteForm.jsx | 56 | |
| 75 | React.createElement( | client/pages/admin/components/accounts/DeleteForm.jsx | 56 | |
| 76 | Button, | client/pages/admin/components/accounts/DeleteForm.jsx | 57 | |
| 77 | { | client/pages/admin/components/accounts/DeleteForm.jsx | 57 | |
| 78 | type: 'submit', | client/pages/admin/components/accounts/DeleteForm.jsx | 58 | |
| 79 | inputClasses: { 'btn-danger': true }, | client/pages/admin/components/accounts/DeleteForm.jsx | 59 | |
| 80 | disabled: this.props.data.loading, | client/pages/admin/components/accounts/DeleteForm.jsx | 60 | |
| 81 | onClick: this.onConfirm }, | client/pages/admin/components/accounts/DeleteForm.jsx | 61 | |
| 82 | 'Delete', | client/pages/admin/components/accounts/DeleteForm.jsx | 61 | |
| 83 | React.createElement(Spinner, { | client/pages/admin/components/accounts/DeleteForm.jsx | 61 | |
| 84 | space: 'left', | client/pages/admin/components/accounts/DeleteForm.jsx | 65 | |
| 85 | show: this.props.data.loading | client/pages/admin/components/accounts/DeleteForm.jsx | 66 | |
| 86 | }) | client/pages/admin/components/accounts/DeleteForm.jsx | 66 | |
| 87 | ) | client/pages/admin/components/accounts/DeleteForm.jsx | 67 | |
| 88 | ) | client/pages/admin/components/accounts/DeleteForm.jsx | 68 | |
| 89 | ) | client/pages/admin/components/accounts/DeleteForm.jsx | 69 | |
| 90 | ); | client/pages/admin/components/accounts/DeleteForm.jsx | 70 | |
| 91 | } | client/pages/admin/components/accounts/DeleteForm.jsx | 72 | |
| 92 | }); | client/pages/admin/components/accounts/DeleteForm.jsx | 73 | |
| 93 | client/pages/admin/components/accounts/DeleteForm.jsx | 74 | ||
| 94 | 1 | module.exports = Component; | client/pages/admin/components/accounts/DeleteForm.jsx | 77 |
| 95 | client/pages/admin/components/accounts/DeleteForm.jsx | 77 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/accounts/Details.jsx | 1 | |
| 2 | client/pages/admin/components/accounts/Details.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/Details.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/accounts/Details.jsx | 2 |
| 5 | 1 | var DetailsForm = require('./DetailsForm'); | client/pages/admin/components/accounts/Details.jsx | 3 |
| 6 | 1 | var UserForm = require('./UserForm'); | client/pages/admin/components/accounts/Details.jsx | 4 |
| 7 | 1 | var StatusForm = require('./StatusForm'); | client/pages/admin/components/accounts/Details.jsx | 5 |
| 8 | 1 | var NoteForm = require('./NoteForm'); | client/pages/admin/components/accounts/Details.jsx | 6 |
| 9 | 1 | var DeleteForm = require('./DeleteForm'); | client/pages/admin/components/accounts/Details.jsx | 7 |
| 10 | 1 | var AccountStore = require('../../stores/Account'); | client/pages/admin/components/accounts/Details.jsx | 8 |
| 11 | 1 | var StatusStore = require('../../stores/Status'); | client/pages/admin/components/accounts/Details.jsx | 9 |
| 12 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/Details.jsx | 10 |
| 13 | 1 | var StatusActions = require('../../actions/Status'); | client/pages/admin/components/accounts/Details.jsx | 11 |
| 14 | client/pages/admin/components/accounts/Details.jsx | 11 | ||
| 15 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/accounts/Details.jsx | 14 |
| 16 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/accounts/Details.jsx | 15 |
| 17 | client/pages/admin/components/accounts/Details.jsx | 15 | ||
| 18 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/Details.jsx | 18 |
| 19 | displayName: 'Component', | client/pages/admin/components/accounts/Details.jsx | 18 | |
| 20 | client/pages/admin/components/accounts/Details.jsx | 18 | ||
| 21 | mixins: [LinkedState], | client/pages/admin/components/accounts/Details.jsx | 19 | |
| 22 | contextTypes: { | client/pages/admin/components/accounts/Details.jsx | 20 | |
| 23 | router: React.PropTypes.func | client/pages/admin/components/accounts/Details.jsx | 21 | |
| 24 | }, | client/pages/admin/components/accounts/Details.jsx | 21 | |
| 25 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/Details.jsx | 23 | |
| 26 | client/pages/admin/components/accounts/Details.jsx | 23 | ||
| 27 | 4 | AccountStore.resetDetails(); | client/pages/admin/components/accounts/Details.jsx | 25 |
| 28 | 4 | AccountStore.resetUser(); | client/pages/admin/components/accounts/Details.jsx | 26 |
| 29 | 4 | AccountStore.resetStatus(); | client/pages/admin/components/accounts/Details.jsx | 27 |
| 30 | 4 | AccountStore.resetNote(); | client/pages/admin/components/accounts/Details.jsx | 28 |
| 31 | 4 | AccountStore.resetDelete(); | client/pages/admin/components/accounts/Details.jsx | 29 |
| 32 | 4 | StatusStore.resetResults(); | client/pages/admin/components/accounts/Details.jsx | 30 |
| 33 | client/pages/admin/components/accounts/Details.jsx | 30 | ||
| 34 | 4 | Actions.getDetails(this.context.router.getCurrentParams()); | client/pages/admin/components/accounts/Details.jsx | 32 |
| 35 | 4 | StatusActions.getResults({ pivot: 'Account', limit: 99 }); | client/pages/admin/components/accounts/Details.jsx | 33 |
| 36 | client/pages/admin/components/accounts/Details.jsx | 33 | ||
| 37 | 4 | return { | client/pages/admin/components/accounts/Details.jsx | 35 |
| 38 | details: AccountStore.getDetails(), | client/pages/admin/components/accounts/Details.jsx | 36 | |
| 39 | user: AccountStore.getUser(), | client/pages/admin/components/accounts/Details.jsx | 37 | |
| 40 | status: AccountStore.getStatus(), | client/pages/admin/components/accounts/Details.jsx | 38 | |
| 41 | note: AccountStore.getNote(), | client/pages/admin/components/accounts/Details.jsx | 39 | |
| 42 | 'delete': AccountStore.getDelete(), | client/pages/admin/components/accounts/Details.jsx | 40 | |
| 43 | statuses: StatusStore.getResults() | client/pages/admin/components/accounts/Details.jsx | 41 | |
| 44 | }; | client/pages/admin/components/accounts/Details.jsx | 41 | |
| 45 | }, | client/pages/admin/components/accounts/Details.jsx | 42 | |
| 46 | componentDidMount: function componentDidMount() { | client/pages/admin/components/accounts/Details.jsx | 44 | |
| 47 | client/pages/admin/components/accounts/Details.jsx | 44 | ||
| 48 | 4 | AccountStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/accounts/Details.jsx | 46 |
| 49 | 4 | StatusStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/accounts/Details.jsx | 47 |
| 50 | }, | client/pages/admin/components/accounts/Details.jsx | 47 | |
| 51 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/accounts/Details.jsx | 49 | |
| 52 | client/pages/admin/components/accounts/Details.jsx | 49 | ||
| 53 | 1 | AccountStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/accounts/Details.jsx | 51 |
| 54 | 1 | StatusStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/accounts/Details.jsx | 52 |
| 55 | }, | client/pages/admin/components/accounts/Details.jsx | 52 | |
| 56 | onStoreChange: function onStoreChange() { | client/pages/admin/components/accounts/Details.jsx | 54 | |
| 57 | client/pages/admin/components/accounts/Details.jsx | 54 | ||
| 58 | 2 | this.setState({ | client/pages/admin/components/accounts/Details.jsx | 56 |
| 59 | details: AccountStore.getDetails(), | client/pages/admin/components/accounts/Details.jsx | 57 | |
| 60 | user: AccountStore.getUser(), | client/pages/admin/components/accounts/Details.jsx | 58 | |
| 61 | status: AccountStore.getStatus(), | client/pages/admin/components/accounts/Details.jsx | 59 | |
| 62 | note: AccountStore.getNote(), | client/pages/admin/components/accounts/Details.jsx | 60 | |
| 63 | 'delete': AccountStore.getDelete(), | client/pages/admin/components/accounts/Details.jsx | 61 | |
| 64 | statuses: StatusStore.getResults() | client/pages/admin/components/accounts/Details.jsx | 62 | |
| 65 | }); | client/pages/admin/components/accounts/Details.jsx | 62 | |
| 66 | }, | client/pages/admin/components/accounts/Details.jsx | 63 | |
| 67 | render: function render() { | client/pages/admin/components/accounts/Details.jsx | 65 | |
| 68 | client/pages/admin/components/accounts/Details.jsx | 65 | ||
| 69 | 7 | if (this.state.details.hydrated && this.state.details.fetchFailure) { | client/pages/admin/components/accounts/Details.jsx | 67 |
| 70 | 1 | return React.createElement( | client/pages/admin/components/accounts/Details.jsx | 68 |
| 71 | 'section', | client/pages/admin/components/accounts/Details.jsx | 69 | |
| 72 | { className: 'section-account-details container' }, | client/pages/admin/components/accounts/Details.jsx | 69 | |
| 73 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 69 | |
| 74 | 'h1', | client/pages/admin/components/accounts/Details.jsx | 70 | |
| 75 | { className: 'page-header' }, | client/pages/admin/components/accounts/Details.jsx | 70 | |
| 76 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 70 | |
| 77 | Link, | client/pages/admin/components/accounts/Details.jsx | 71 | |
| 78 | { to: 'accounts' }, | client/pages/admin/components/accounts/Details.jsx | 71 | |
| 79 | 'Accounts' | client/pages/admin/components/accounts/Details.jsx | 71 | |
| 80 | ), | client/pages/admin/components/accounts/Details.jsx | 71 | |
| 81 | ' / Error' | client/pages/admin/components/accounts/Details.jsx | 71 | |
| 82 | ), | client/pages/admin/components/accounts/Details.jsx | 71 | |
| 83 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 72 | |
| 84 | 'div', | client/pages/admin/components/accounts/Details.jsx | 73 | |
| 85 | { className: 'alert alert-danger' }, | client/pages/admin/components/accounts/Details.jsx | 73 | |
| 86 | this.state.details.error | client/pages/admin/components/accounts/Details.jsx | 73 | |
| 87 | ) | client/pages/admin/components/accounts/Details.jsx | 74 | |
| 88 | ); | client/pages/admin/components/accounts/Details.jsx | 75 | |
| 89 | } | client/pages/admin/components/accounts/Details.jsx | 77 | |
| 90 | client/pages/admin/components/accounts/Details.jsx | 78 | ||
| 91 | 6 | return React.createElement( | client/pages/admin/components/accounts/Details.jsx | 80 |
| 92 | 'section', | client/pages/admin/components/accounts/Details.jsx | 81 | |
| 93 | { className: 'section-account-details container' }, | client/pages/admin/components/accounts/Details.jsx | 81 | |
| 94 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 81 | |
| 95 | 'h1', | client/pages/admin/components/accounts/Details.jsx | 82 | |
| 96 | { className: 'page-header' }, | client/pages/admin/components/accounts/Details.jsx | 82 | |
| 97 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 82 | |
| 98 | Link, | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 99 | { to: 'accounts' }, | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 100 | 'Accounts' | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 101 | ), | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 102 | ' / ', | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 103 | this.state.details.name.first, | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 104 | ' ', | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 105 | this.state.details.name.last | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 106 | ), | client/pages/admin/components/accounts/Details.jsx | 83 | |
| 107 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 84 | |
| 108 | 'div', | client/pages/admin/components/accounts/Details.jsx | 85 | |
| 109 | { className: 'row' }, | client/pages/admin/components/accounts/Details.jsx | 85 | |
| 110 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 85 | |
| 111 | 'div', | client/pages/admin/components/accounts/Details.jsx | 86 | |
| 112 | { className: 'col-sm-8' }, | client/pages/admin/components/accounts/Details.jsx | 86 | |
| 113 | React.createElement(DetailsForm, { data: this.state.details }), | client/pages/admin/components/accounts/Details.jsx | 86 | |
| 114 | React.createElement(UserForm, { | client/pages/admin/components/accounts/Details.jsx | 87 | |
| 115 | details: this.state.details, | client/pages/admin/components/accounts/Details.jsx | 89 | |
| 116 | data: this.state.user | client/pages/admin/components/accounts/Details.jsx | 90 | |
| 117 | }), | client/pages/admin/components/accounts/Details.jsx | 90 | |
| 118 | React.createElement(DeleteForm, { | client/pages/admin/components/accounts/Details.jsx | 91 | |
| 119 | details: this.state.details, | client/pages/admin/components/accounts/Details.jsx | 93 | |
| 120 | data: this.state['delete'] | client/pages/admin/components/accounts/Details.jsx | 94 | |
| 121 | }) | client/pages/admin/components/accounts/Details.jsx | 94 | |
| 122 | ), | client/pages/admin/components/accounts/Details.jsx | 95 | |
| 123 | React.createElement( | client/pages/admin/components/accounts/Details.jsx | 96 | |
| 124 | 'div', | client/pages/admin/components/accounts/Details.jsx | 97 | |
| 125 | { className: 'col-sm-4' }, | client/pages/admin/components/accounts/Details.jsx | 97 | |
| 126 | React.createElement(StatusForm, { | client/pages/admin/components/accounts/Details.jsx | 97 | |
| 127 | details: this.state.details, | client/pages/admin/components/accounts/Details.jsx | 99 | |
| 128 | data: this.state.status, | client/pages/admin/components/accounts/Details.jsx | 100 | |
| 129 | list: this.state.statuses | client/pages/admin/components/accounts/Details.jsx | 101 | |
| 130 | }), | client/pages/admin/components/accounts/Details.jsx | 101 | |
| 131 | React.createElement(NoteForm, { | client/pages/admin/components/accounts/Details.jsx | 102 | |
| 132 | details: this.state.details, | client/pages/admin/components/accounts/Details.jsx | 104 | |
| 133 | data: this.state.note | client/pages/admin/components/accounts/Details.jsx | 105 | |
| 134 | }) | client/pages/admin/components/accounts/Details.jsx | 105 | |
| 135 | ) | client/pages/admin/components/accounts/Details.jsx | 106 | |
| 136 | ) | client/pages/admin/components/accounts/Details.jsx | 107 | |
| 137 | ); | client/pages/admin/components/accounts/Details.jsx | 108 | |
| 138 | } | client/pages/admin/components/accounts/Details.jsx | 110 | |
| 139 | }); | client/pages/admin/components/accounts/Details.jsx | 111 | |
| 140 | client/pages/admin/components/accounts/Details.jsx | 112 | ||
| 141 | 1 | module.exports = Component; | client/pages/admin/components/accounts/Details.jsx | 115 |
| 142 | client/pages/admin/components/accounts/Details.jsx | 115 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/accounts/DetailsForm.jsx | 1 | |
| 2 | client/pages/admin/components/accounts/DetailsForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/DetailsForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/accounts/DetailsForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/accounts/DetailsForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/accounts/DetailsForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/accounts/DetailsForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/DetailsForm.jsx | 6 |
| 9 | client/pages/admin/components/accounts/DetailsForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/DetailsForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/admin/components/accounts/DetailsForm.jsx | 9 | |
| 12 | client/pages/admin/components/accounts/DetailsForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/accounts/DetailsForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/DetailsForm.jsx | 11 | |
| 15 | client/pages/admin/components/accounts/DetailsForm.jsx | 11 | ||
| 16 | 10 | return {}; | client/pages/admin/components/accounts/DetailsForm.jsx | 13 |
| 17 | }, | client/pages/admin/components/accounts/DetailsForm.jsx | 13 | |
| 18 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/accounts/DetailsForm.jsx | 15 | |
| 19 | client/pages/admin/components/accounts/DetailsForm.jsx | 15 | ||
| 20 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/accounts/DetailsForm.jsx | 17 |
| 21 | 5 | this.setState({ | client/pages/admin/components/accounts/DetailsForm.jsx | 18 |
| 22 | hydrated: nextProps.data.hydrated, | client/pages/admin/components/accounts/DetailsForm.jsx | 19 | |
| 23 | nameFirst: nextProps.data.name.first, | client/pages/admin/components/accounts/DetailsForm.jsx | 20 | |
| 24 | nameMiddle: nextProps.data.name.middle, | client/pages/admin/components/accounts/DetailsForm.jsx | 21 | |
| 25 | nameLast: nextProps.data.name.last | client/pages/admin/components/accounts/DetailsForm.jsx | 22 | |
| 26 | }); | client/pages/admin/components/accounts/DetailsForm.jsx | 22 | |
| 27 | } | client/pages/admin/components/accounts/DetailsForm.jsx | 23 | |
| 28 | }, | client/pages/admin/components/accounts/DetailsForm.jsx | 24 | |
| 29 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/accounts/DetailsForm.jsx | 26 | |
| 30 | client/pages/admin/components/accounts/DetailsForm.jsx | 26 | ||
| 31 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/DetailsForm.jsx | 28 |
| 32 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/DetailsForm.jsx | 29 |
| 33 | client/pages/admin/components/accounts/DetailsForm.jsx | 29 | ||
| 34 | 1 | Actions.saveDetails({ | client/pages/admin/components/accounts/DetailsForm.jsx | 31 |
| 35 | id: this.props.data._id, | client/pages/admin/components/accounts/DetailsForm.jsx | 32 | |
| 36 | nameFirst: this.state.nameFirst, | client/pages/admin/components/accounts/DetailsForm.jsx | 33 | |
| 37 | nameMiddle: this.state.nameMiddle, | client/pages/admin/components/accounts/DetailsForm.jsx | 34 | |
| 38 | nameLast: this.state.nameLast | client/pages/admin/components/accounts/DetailsForm.jsx | 35 | |
| 39 | }); | client/pages/admin/components/accounts/DetailsForm.jsx | 35 | |
| 40 | }, | client/pages/admin/components/accounts/DetailsForm.jsx | 36 | |
| 41 | render: function render() { | client/pages/admin/components/accounts/DetailsForm.jsx | 38 | |
| 42 | client/pages/admin/components/accounts/DetailsForm.jsx | 38 | ||
| 43 | 16 | var alerts = []; | client/pages/admin/components/accounts/DetailsForm.jsx | 40 |
| 44 | 16 | if (this.props.data.success) { | client/pages/admin/components/accounts/DetailsForm.jsx | 41 |
| 45 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 42 |
| 46 | 'div', | client/pages/admin/components/accounts/DetailsForm.jsx | 42 | |
| 47 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/accounts/DetailsForm.jsx | 42 | |
| 48 | 'Success. Changes have been saved.' | client/pages/admin/components/accounts/DetailsForm.jsx | 42 | |
| 49 | )); | client/pages/admin/components/accounts/DetailsForm.jsx | 42 | |
| 50 | 15 | } else if (this.props.data.error) { | client/pages/admin/components/accounts/DetailsForm.jsx | 44 |
| 51 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 47 |
| 52 | 'div', | client/pages/admin/components/accounts/DetailsForm.jsx | 47 | |
| 53 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/accounts/DetailsForm.jsx | 47 | |
| 54 | this.props.data.error | client/pages/admin/components/accounts/DetailsForm.jsx | 47 | |
| 55 | )); | client/pages/admin/components/accounts/DetailsForm.jsx | 48 | |
| 56 | } | client/pages/admin/components/accounts/DetailsForm.jsx | 49 | |
| 57 | client/pages/admin/components/accounts/DetailsForm.jsx | 50 | ||
| 58 | 16 | var notice; | client/pages/admin/components/accounts/DetailsForm.jsx | 52 |
| 59 | 16 | if (!this.props.data.hydrated) { | client/pages/admin/components/accounts/DetailsForm.jsx | 53 |
| 60 | 12 | notice = React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 54 |
| 61 | 'div', | client/pages/admin/components/accounts/DetailsForm.jsx | 54 | |
| 62 | { className: 'alert alert-info' }, | client/pages/admin/components/accounts/DetailsForm.jsx | 54 | |
| 63 | 'Loading data...' | client/pages/admin/components/accounts/DetailsForm.jsx | 54 | |
| 64 | ); | client/pages/admin/components/accounts/DetailsForm.jsx | 54 | |
| 65 | } | client/pages/admin/components/accounts/DetailsForm.jsx | 56 | |
| 66 | client/pages/admin/components/accounts/DetailsForm.jsx | 57 | ||
| 67 | 16 | var formElements; | client/pages/admin/components/accounts/DetailsForm.jsx | 59 |
| 68 | 16 | if (this.props.data.hydrated) { | client/pages/admin/components/accounts/DetailsForm.jsx | 60 |
| 69 | 4 | formElements = React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 61 |
| 70 | 'fieldset', | client/pages/admin/components/accounts/DetailsForm.jsx | 61 | |
| 71 | null, | client/pages/admin/components/accounts/DetailsForm.jsx | 61 | |
| 72 | React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 61 | |
| 73 | 'legend', | client/pages/admin/components/accounts/DetailsForm.jsx | 62 | |
| 74 | null, | client/pages/admin/components/accounts/DetailsForm.jsx | 62 | |
| 75 | 'Details' | client/pages/admin/components/accounts/DetailsForm.jsx | 62 | |
| 76 | ), | client/pages/admin/components/accounts/DetailsForm.jsx | 62 | |
| 77 | alerts, | client/pages/admin/components/accounts/DetailsForm.jsx | 62 | |
| 78 | React.createElement(TextControl, { | client/pages/admin/components/accounts/DetailsForm.jsx | 63 | |
| 79 | name: 'nameFirst', | client/pages/admin/components/accounts/DetailsForm.jsx | 65 | |
| 80 | label: 'First name', | client/pages/admin/components/accounts/DetailsForm.jsx | 66 | |
| 81 | hasError: this.props.data.hasError.nameFirst, | client/pages/admin/components/accounts/DetailsForm.jsx | 67 | |
| 82 | valueLink: this.linkState('nameFirst'), | client/pages/admin/components/accounts/DetailsForm.jsx | 68 | |
| 83 | help: this.props.data.help.nameFirst, | client/pages/admin/components/accounts/DetailsForm.jsx | 69 | |
| 84 | disabled: this.props.data.loading | client/pages/admin/components/accounts/DetailsForm.jsx | 70 | |
| 85 | }), | client/pages/admin/components/accounts/DetailsForm.jsx | 70 | |
| 86 | React.createElement(TextControl, { | client/pages/admin/components/accounts/DetailsForm.jsx | 71 | |
| 87 | name: 'nameMiddle', | client/pages/admin/components/accounts/DetailsForm.jsx | 73 | |
| 88 | label: 'Middle name', | client/pages/admin/components/accounts/DetailsForm.jsx | 74 | |
| 89 | hasError: this.props.data.hasError.nameMiddle, | client/pages/admin/components/accounts/DetailsForm.jsx | 75 | |
| 90 | valueLink: this.linkState('nameMiddle'), | client/pages/admin/components/accounts/DetailsForm.jsx | 76 | |
| 91 | help: this.props.data.help.nameMiddle, | client/pages/admin/components/accounts/DetailsForm.jsx | 77 | |
| 92 | disabled: this.props.data.loading | client/pages/admin/components/accounts/DetailsForm.jsx | 78 | |
| 93 | }), | client/pages/admin/components/accounts/DetailsForm.jsx | 78 | |
| 94 | React.createElement(TextControl, { | client/pages/admin/components/accounts/DetailsForm.jsx | 79 | |
| 95 | name: 'nameLast', | client/pages/admin/components/accounts/DetailsForm.jsx | 81 | |
| 96 | label: 'Last name', | client/pages/admin/components/accounts/DetailsForm.jsx | 82 | |
| 97 | hasError: this.props.data.hasError.nameLast, | client/pages/admin/components/accounts/DetailsForm.jsx | 83 | |
| 98 | valueLink: this.linkState('nameLast'), | client/pages/admin/components/accounts/DetailsForm.jsx | 84 | |
| 99 | help: this.props.data.help.nameLast, | client/pages/admin/components/accounts/DetailsForm.jsx | 85 | |
| 100 | disabled: this.props.data.loading | client/pages/admin/components/accounts/DetailsForm.jsx | 86 | |
| 101 | }), | client/pages/admin/components/accounts/DetailsForm.jsx | 86 | |
| 102 | React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 87 | |
| 103 | ControlGroup, | client/pages/admin/components/accounts/DetailsForm.jsx | 88 | |
| 104 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/accounts/DetailsForm.jsx | 88 | |
| 105 | React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 88 | |
| 106 | Button, | client/pages/admin/components/accounts/DetailsForm.jsx | 89 | |
| 107 | { | client/pages/admin/components/accounts/DetailsForm.jsx | 89 | |
| 108 | type: 'submit', | client/pages/admin/components/accounts/DetailsForm.jsx | 90 | |
| 109 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/accounts/DetailsForm.jsx | 91 | |
| 110 | disabled: this.props.data.loading }, | client/pages/admin/components/accounts/DetailsForm.jsx | 92 | |
| 111 | 'Save changes', | client/pages/admin/components/accounts/DetailsForm.jsx | 92 | |
| 112 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/accounts/DetailsForm.jsx | 92 | |
| 113 | ) | client/pages/admin/components/accounts/DetailsForm.jsx | 95 | |
| 114 | ) | client/pages/admin/components/accounts/DetailsForm.jsx | 96 | |
| 115 | ); | client/pages/admin/components/accounts/DetailsForm.jsx | 97 | |
| 116 | } | client/pages/admin/components/accounts/DetailsForm.jsx | 98 | |
| 117 | client/pages/admin/components/accounts/DetailsForm.jsx | 99 | ||
| 118 | 16 | return React.createElement( | client/pages/admin/components/accounts/DetailsForm.jsx | 101 |
| 119 | 'form', | client/pages/admin/components/accounts/DetailsForm.jsx | 102 | |
| 120 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/accounts/DetailsForm.jsx | 102 | |
| 121 | notice, | client/pages/admin/components/accounts/DetailsForm.jsx | 102 | |
| 122 | formElements | client/pages/admin/components/accounts/DetailsForm.jsx | 103 | |
| 123 | ); | client/pages/admin/components/accounts/DetailsForm.jsx | 104 | |
| 124 | } | client/pages/admin/components/accounts/DetailsForm.jsx | 106 | |
| 125 | }); | client/pages/admin/components/accounts/DetailsForm.jsx | 107 | |
| 126 | client/pages/admin/components/accounts/DetailsForm.jsx | 108 | ||
| 127 | 1 | module.exports = Component; | client/pages/admin/components/accounts/DetailsForm.jsx | 111 |
| 128 | client/pages/admin/components/accounts/DetailsForm.jsx | 111 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/accounts/FilterForm.jsx | 1 | |
| 2 | client/pages/admin/components/accounts/FilterForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/FilterForm.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/pages/admin/components/accounts/FilterForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/accounts/FilterForm.jsx | 3 |
| 6 | 1 | var SelectControl = require('../../../../components/form/SelectControl'); | client/pages/admin/components/accounts/FilterForm.jsx | 4 |
| 7 | client/pages/admin/components/accounts/FilterForm.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/FilterForm.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/accounts/FilterForm.jsx | 7 | |
| 10 | client/pages/admin/components/accounts/FilterForm.jsx | 7 | ||
| 11 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/accounts/FilterForm.jsx | 8 | |
| 12 | defaultState: { | client/pages/admin/components/accounts/FilterForm.jsx | 9 | |
| 13 | username: '', | client/pages/admin/components/accounts/FilterForm.jsx | 10 | |
| 14 | sort: '_id', | client/pages/admin/components/accounts/FilterForm.jsx | 11 | |
| 15 | limit: 20, | client/pages/admin/components/accounts/FilterForm.jsx | 12 | |
| 16 | page: 1 | client/pages/admin/components/accounts/FilterForm.jsx | 13 | |
| 17 | }, | client/pages/admin/components/accounts/FilterForm.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/FilterForm.jsx | 15 | |
| 19 | client/pages/admin/components/accounts/FilterForm.jsx | 15 | ||
| 20 | 14 | return ObjectAssign({}, this.defaultState, this.props.query); | client/pages/admin/components/accounts/FilterForm.jsx | 17 |
| 21 | }, | client/pages/admin/components/accounts/FilterForm.jsx | 17 | |
| 22 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/accounts/FilterForm.jsx | 19 | |
| 23 | client/pages/admin/components/accounts/FilterForm.jsx | 19 | ||
| 24 | 6 | var nextState = ObjectAssign({}, this.defaultState, nextProps.query); | client/pages/admin/components/accounts/FilterForm.jsx | 21 |
| 25 | 6 | this.setState(nextState); | client/pages/admin/components/accounts/FilterForm.jsx | 22 |
| 26 | }, | client/pages/admin/components/accounts/FilterForm.jsx | 22 | |
| 27 | onMenuChange: function onMenuChange(event) { | client/pages/admin/components/accounts/FilterForm.jsx | 24 | |
| 28 | client/pages/admin/components/accounts/FilterForm.jsx | 24 | ||
| 29 | 2 | var newState = { page: 1 }; | client/pages/admin/components/accounts/FilterForm.jsx | 26 |
| 30 | 2 | newState[event.target.name] = event.target.value; | client/pages/admin/components/accounts/FilterForm.jsx | 27 |
| 31 | 2 | this.setState(newState, this.props.onChange); | client/pages/admin/components/accounts/FilterForm.jsx | 28 |
| 32 | }, | client/pages/admin/components/accounts/FilterForm.jsx | 28 | |
| 33 | onEnterSubmit: function onEnterSubmit(event) { | client/pages/admin/components/accounts/FilterForm.jsx | 30 | |
| 34 | client/pages/admin/components/accounts/FilterForm.jsx | 30 | ||
| 35 | 2 | if (event.which === 13) { | client/pages/admin/components/accounts/FilterForm.jsx | 32 |
| 36 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/FilterForm.jsx | 33 |
| 37 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/FilterForm.jsx | 34 |
| 38 | 1 | this.setState({ page: 1 }, this.props.onChange); | client/pages/admin/components/accounts/FilterForm.jsx | 35 |
| 39 | } | client/pages/admin/components/accounts/FilterForm.jsx | 35 | |
| 40 | }, | client/pages/admin/components/accounts/FilterForm.jsx | 36 | |
| 41 | changePage: function changePage(page) { | client/pages/admin/components/accounts/FilterForm.jsx | 38 | |
| 42 | client/pages/admin/components/accounts/FilterForm.jsx | 38 | ||
| 43 | 2 | this.setState({ page: page }, this.props.onChange); | client/pages/admin/components/accounts/FilterForm.jsx | 40 |
| 44 | }, | client/pages/admin/components/accounts/FilterForm.jsx | 40 | |
| 45 | render: function render() { | client/pages/admin/components/accounts/FilterForm.jsx | 42 | |
| 46 | client/pages/admin/components/accounts/FilterForm.jsx | 42 | ||
| 47 | 25 | return React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 44 |
| 48 | 'form', | client/pages/admin/components/accounts/FilterForm.jsx | 45 | |
| 49 | { onKeyDown: this.onEnterSubmit, onSubmit: this.props.onChange }, | client/pages/admin/components/accounts/FilterForm.jsx | 45 | |
| 50 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 45 | |
| 51 | 'div', | client/pages/admin/components/accounts/FilterForm.jsx | 46 | |
| 52 | { className: 'row' }, | client/pages/admin/components/accounts/FilterForm.jsx | 46 | |
| 53 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 46 | |
| 54 | 'div', | client/pages/admin/components/accounts/FilterForm.jsx | 47 | |
| 55 | { className: 'col-sm-4' }, | client/pages/admin/components/accounts/FilterForm.jsx | 47 | |
| 56 | React.createElement(TextControl, { | client/pages/admin/components/accounts/FilterForm.jsx | 47 | |
| 57 | name: 'username', | client/pages/admin/components/accounts/FilterForm.jsx | 49 | |
| 58 | label: 'Username search', | client/pages/admin/components/accounts/FilterForm.jsx | 50 | |
| 59 | valueLink: this.linkState('username'), | client/pages/admin/components/accounts/FilterForm.jsx | 51 | |
| 60 | disabled: this.props.loading | client/pages/admin/components/accounts/FilterForm.jsx | 52 | |
| 61 | }) | client/pages/admin/components/accounts/FilterForm.jsx | 52 | |
| 62 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 53 | |
| 63 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 54 | |
| 64 | 'div', | client/pages/admin/components/accounts/FilterForm.jsx | 55 | |
| 65 | { className: 'col-sm-4' }, | client/pages/admin/components/accounts/FilterForm.jsx | 55 | |
| 66 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 55 | |
| 67 | SelectControl, | client/pages/admin/components/accounts/FilterForm.jsx | 56 | |
| 68 | { | client/pages/admin/components/accounts/FilterForm.jsx | 56 | |
| 69 | name: 'sort', | client/pages/admin/components/accounts/FilterForm.jsx | 57 | |
| 70 | label: 'Sort by', | client/pages/admin/components/accounts/FilterForm.jsx | 58 | |
| 71 | disabled: this.props.loading, | client/pages/admin/components/accounts/FilterForm.jsx | 59 | |
| 72 | onChange: this.onMenuChange, | client/pages/admin/components/accounts/FilterForm.jsx | 60 | |
| 73 | value: this.state.sort }, | client/pages/admin/components/accounts/FilterForm.jsx | 61 | |
| 74 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 61 | |
| 75 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 63 | |
| 76 | { value: '_id' }, | client/pages/admin/components/accounts/FilterForm.jsx | 63 | |
| 77 | 'id â–²' | client/pages/admin/components/accounts/FilterForm.jsx | 63 | |
| 78 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 63 | |
| 79 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 63 | |
| 80 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 64 | |
| 81 | { value: '-_id' }, | client/pages/admin/components/accounts/FilterForm.jsx | 64 | |
| 82 | 'id â–¼' | client/pages/admin/components/accounts/FilterForm.jsx | 64 | |
| 83 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 64 | |
| 84 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 64 | |
| 85 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 65 | |
| 86 | { value: 'username' }, | client/pages/admin/components/accounts/FilterForm.jsx | 65 | |
| 87 | 'username â–²' | client/pages/admin/components/accounts/FilterForm.jsx | 65 | |
| 88 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 65 | |
| 89 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 65 | |
| 90 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 66 | |
| 91 | { value: '-username' }, | client/pages/admin/components/accounts/FilterForm.jsx | 66 | |
| 92 | 'username â–¼' | client/pages/admin/components/accounts/FilterForm.jsx | 66 | |
| 93 | ) | client/pages/admin/components/accounts/FilterForm.jsx | 66 | |
| 94 | ) | client/pages/admin/components/accounts/FilterForm.jsx | 66 | |
| 95 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 67 | |
| 96 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 68 | |
| 97 | 'div', | client/pages/admin/components/accounts/FilterForm.jsx | 69 | |
| 98 | { className: 'col-sm-4' }, | client/pages/admin/components/accounts/FilterForm.jsx | 69 | |
| 99 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 69 | |
| 100 | SelectControl, | client/pages/admin/components/accounts/FilterForm.jsx | 70 | |
| 101 | { | client/pages/admin/components/accounts/FilterForm.jsx | 70 | |
| 102 | name: 'limit', | client/pages/admin/components/accounts/FilterForm.jsx | 71 | |
| 103 | label: 'Limit', | client/pages/admin/components/accounts/FilterForm.jsx | 72 | |
| 104 | disabled: this.props.loading, | client/pages/admin/components/accounts/FilterForm.jsx | 73 | |
| 105 | onChange: this.onMenuChange, | client/pages/admin/components/accounts/FilterForm.jsx | 74 | |
| 106 | value: this.state.limit }, | client/pages/admin/components/accounts/FilterForm.jsx | 75 | |
| 107 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 75 | |
| 108 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 77 | |
| 109 | { value: 10 }, | client/pages/admin/components/accounts/FilterForm.jsx | 77 | |
| 110 | '10 items' | client/pages/admin/components/accounts/FilterForm.jsx | 77 | |
| 111 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 77 | |
| 112 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 77 | |
| 113 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 78 | |
| 114 | { value: 20 }, | client/pages/admin/components/accounts/FilterForm.jsx | 78 | |
| 115 | '20 items' | client/pages/admin/components/accounts/FilterForm.jsx | 78 | |
| 116 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 78 | |
| 117 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 78 | |
| 118 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 79 | |
| 119 | { value: 50 }, | client/pages/admin/components/accounts/FilterForm.jsx | 79 | |
| 120 | '50 items' | client/pages/admin/components/accounts/FilterForm.jsx | 79 | |
| 121 | ), | client/pages/admin/components/accounts/FilterForm.jsx | 79 | |
| 122 | React.createElement( | client/pages/admin/components/accounts/FilterForm.jsx | 79 | |
| 123 | 'option', | client/pages/admin/components/accounts/FilterForm.jsx | 80 | |
| 124 | { value: 100 }, | client/pages/admin/components/accounts/FilterForm.jsx | 80 | |
| 125 | '100 items' | client/pages/admin/components/accounts/FilterForm.jsx | 80 | |
| 126 | ) | client/pages/admin/components/accounts/FilterForm.jsx | 80 | |
| 127 | ) | client/pages/admin/components/accounts/FilterForm.jsx | 80 | |
| 128 | ) | client/pages/admin/components/accounts/FilterForm.jsx | 81 | |
| 129 | ) | client/pages/admin/components/accounts/FilterForm.jsx | 82 | |
| 130 | ); | client/pages/admin/components/accounts/FilterForm.jsx | 83 | |
| 131 | } | client/pages/admin/components/accounts/FilterForm.jsx | 85 | |
| 132 | }); | client/pages/admin/components/accounts/FilterForm.jsx | 86 | |
| 133 | client/pages/admin/components/accounts/FilterForm.jsx | 87 | ||
| 134 | 1 | module.exports = Component; | client/pages/admin/components/accounts/FilterForm.jsx | 90 |
| 135 | client/pages/admin/components/accounts/FilterForm.jsx | 90 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/accounts/NoteForm.jsx | 1 | |
| 2 | client/pages/admin/components/accounts/NoteForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/NoteForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/accounts/NoteForm.jsx | 2 |
| 5 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/accounts/NoteForm.jsx | 3 |
| 6 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/NoteForm.jsx | 4 |
| 7 | client/pages/admin/components/accounts/NoteForm.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/NoteForm.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/accounts/NoteForm.jsx | 7 | |
| 10 | client/pages/admin/components/accounts/NoteForm.jsx | 7 | ||
| 11 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/accounts/NoteForm.jsx | 8 | |
| 12 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/NoteForm.jsx | 9 | |
| 13 | client/pages/admin/components/accounts/NoteForm.jsx | 9 | ||
| 14 | 12 | return {}; | client/pages/admin/components/accounts/NoteForm.jsx | 11 |
| 15 | }, | client/pages/admin/components/accounts/NoteForm.jsx | 11 | |
| 16 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/accounts/NoteForm.jsx | 13 | |
| 17 | client/pages/admin/components/accounts/NoteForm.jsx | 13 | ||
| 18 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/NoteForm.jsx | 15 |
| 19 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/NoteForm.jsx | 16 |
| 20 | client/pages/admin/components/accounts/NoteForm.jsx | 16 | ||
| 21 | 1 | Actions.newNote({ | client/pages/admin/components/accounts/NoteForm.jsx | 18 |
| 22 | id: this.props.details._id, | client/pages/admin/components/accounts/NoteForm.jsx | 19 | |
| 23 | data: this.state.newNote | client/pages/admin/components/accounts/NoteForm.jsx | 20 | |
| 24 | }); | client/pages/admin/components/accounts/NoteForm.jsx | 20 | |
| 25 | client/pages/admin/components/accounts/NoteForm.jsx | 21 | ||
| 26 | 1 | this.setState({ newNote: '' }); | client/pages/admin/components/accounts/NoteForm.jsx | 23 |
| 27 | }, | client/pages/admin/components/accounts/NoteForm.jsx | 23 | |
| 28 | render: function render() { | client/pages/admin/components/accounts/NoteForm.jsx | 25 | |
| 29 | client/pages/admin/components/accounts/NoteForm.jsx | 25 | ||
| 30 | 19 | var alerts = []; | client/pages/admin/components/accounts/NoteForm.jsx | 27 |
| 31 | 19 | if (this.props.data.success) { | client/pages/admin/components/accounts/NoteForm.jsx | 28 |
| 32 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 29 |
| 33 | 'div', | client/pages/admin/components/accounts/NoteForm.jsx | 29 | |
| 34 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/accounts/NoteForm.jsx | 29 | |
| 35 | 'Success. Changes have been saved.' | client/pages/admin/components/accounts/NoteForm.jsx | 29 | |
| 36 | )); | client/pages/admin/components/accounts/NoteForm.jsx | 29 | |
| 37 | 18 | } else if (this.props.data.error) { | client/pages/admin/components/accounts/NoteForm.jsx | 31 |
| 38 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 34 |
| 39 | 'div', | client/pages/admin/components/accounts/NoteForm.jsx | 34 | |
| 40 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/accounts/NoteForm.jsx | 34 | |
| 41 | this.props.data.error | client/pages/admin/components/accounts/NoteForm.jsx | 34 | |
| 42 | )); | client/pages/admin/components/accounts/NoteForm.jsx | 35 | |
| 43 | } | client/pages/admin/components/accounts/NoteForm.jsx | 36 | |
| 44 | client/pages/admin/components/accounts/NoteForm.jsx | 37 | ||
| 45 | 19 | var notice; | client/pages/admin/components/accounts/NoteForm.jsx | 39 |
| 46 | 19 | if (!this.props.details.hydrated) { | client/pages/admin/components/accounts/NoteForm.jsx | 40 |
| 47 | 11 | notice = React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 41 |
| 48 | 'div', | client/pages/admin/components/accounts/NoteForm.jsx | 41 | |
| 49 | { className: 'alert alert-info' }, | client/pages/admin/components/accounts/NoteForm.jsx | 41 | |
| 50 | 'Loading data...' | client/pages/admin/components/accounts/NoteForm.jsx | 41 | |
| 51 | ); | client/pages/admin/components/accounts/NoteForm.jsx | 41 | |
| 52 | } | client/pages/admin/components/accounts/NoteForm.jsx | 43 | |
| 53 | client/pages/admin/components/accounts/NoteForm.jsx | 44 | ||
| 54 | 19 | var formElements; | client/pages/admin/components/accounts/NoteForm.jsx | 46 |
| 55 | 19 | if (this.props.details.hydrated) { | client/pages/admin/components/accounts/NoteForm.jsx | 47 |
| 56 | 8 | var noteData = this.props.details.notes || []; | client/pages/admin/components/accounts/NoteForm.jsx | 48 |
| 57 | 8 | var noteHistory = noteData.map(function (note) { | client/pages/admin/components/accounts/NoteForm.jsx | 49 |
| 58 | client/pages/admin/components/accounts/NoteForm.jsx | 49 | ||
| 59 | 1 | return React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 51 |
| 60 | 'li', | client/pages/admin/components/accounts/NoteForm.jsx | 52 | |
| 61 | { key: note.timeCreated, className: 'list-group-item' }, | client/pages/admin/components/accounts/NoteForm.jsx | 52 | |
| 62 | React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 52 | |
| 63 | 'div', | client/pages/admin/components/accounts/NoteForm.jsx | 53 | |
| 64 | null, | client/pages/admin/components/accounts/NoteForm.jsx | 53 | |
| 65 | note.data | client/pages/admin/components/accounts/NoteForm.jsx | 53 | |
| 66 | ), | client/pages/admin/components/accounts/NoteForm.jsx | 53 | |
| 67 | React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 53 | |
| 68 | 'span', | client/pages/admin/components/accounts/NoteForm.jsx | 54 | |
| 69 | { | client/pages/admin/components/accounts/NoteForm.jsx | 54 | |
| 70 | title: note.moment.toString(), | client/pages/admin/components/accounts/NoteForm.jsx | 55 | |
| 71 | className: 'badge' }, | client/pages/admin/components/accounts/NoteForm.jsx | 56 | |
| 72 | note.userCreated.name, | client/pages/admin/components/accounts/NoteForm.jsx | 56 | |
| 73 | ' - ', | client/pages/admin/components/accounts/NoteForm.jsx | 58 | |
| 74 | note.moment.fromNow() | client/pages/admin/components/accounts/NoteForm.jsx | 58 | |
| 75 | ), | client/pages/admin/components/accounts/NoteForm.jsx | 58 | |
| 76 | React.createElement('div', { className: 'clearfix' }) | client/pages/admin/components/accounts/NoteForm.jsx | 59 | |
| 77 | ); | client/pages/admin/components/accounts/NoteForm.jsx | 60 | |
| 78 | }); | client/pages/admin/components/accounts/NoteForm.jsx | 62 | |
| 79 | client/pages/admin/components/accounts/NoteForm.jsx | 63 | ||
| 80 | 8 | formElements = React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 65 |
| 81 | 'fieldset', | client/pages/admin/components/accounts/NoteForm.jsx | 65 | |
| 82 | null, | client/pages/admin/components/accounts/NoteForm.jsx | 65 | |
| 83 | React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 65 | |
| 84 | 'legend', | client/pages/admin/components/accounts/NoteForm.jsx | 66 | |
| 85 | null, | client/pages/admin/components/accounts/NoteForm.jsx | 66 | |
| 86 | 'Notes' | client/pages/admin/components/accounts/NoteForm.jsx | 66 | |
| 87 | ), | client/pages/admin/components/accounts/NoteForm.jsx | 66 | |
| 88 | alerts, | client/pages/admin/components/accounts/NoteForm.jsx | 66 | |
| 89 | React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 67 | |
| 90 | ControlGroup, | client/pages/admin/components/accounts/NoteForm.jsx | 68 | |
| 91 | { | client/pages/admin/components/accounts/NoteForm.jsx | 68 | |
| 92 | groupClasses: { 'form-group-notes': true }, | client/pages/admin/components/accounts/NoteForm.jsx | 69 | |
| 93 | hideLabel: true, | client/pages/admin/components/accounts/NoteForm.jsx | 70 | |
| 94 | hasError: this.props.data.hasError.data, | client/pages/admin/components/accounts/NoteForm.jsx | 71 | |
| 95 | help: this.props.data.help.data }, | client/pages/admin/components/accounts/NoteForm.jsx | 72 | |
| 96 | React.createElement('textarea', { | client/pages/admin/components/accounts/NoteForm.jsx | 72 | |
| 97 | ref: 'newNote', | client/pages/admin/components/accounts/NoteForm.jsx | 75 | |
| 98 | name: 'newNote', | client/pages/admin/components/accounts/NoteForm.jsx | 76 | |
| 99 | rows: '3', | client/pages/admin/components/accounts/NoteForm.jsx | 77 | |
| 100 | className: 'form-control', | client/pages/admin/components/accounts/NoteForm.jsx | 78 | |
| 101 | valueLink: this.linkState('newNote') }), | client/pages/admin/components/accounts/NoteForm.jsx | 79 | |
| 102 | React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 80 | |
| 103 | 'button', | client/pages/admin/components/accounts/NoteForm.jsx | 81 | |
| 104 | { | client/pages/admin/components/accounts/NoteForm.jsx | 81 | |
| 105 | ref: 'newNoteButton', | client/pages/admin/components/accounts/NoteForm.jsx | 82 | |
| 106 | type: 'submit', | client/pages/admin/components/accounts/NoteForm.jsx | 83 | |
| 107 | className: 'btn btn-default btn-block' }, | client/pages/admin/components/accounts/NoteForm.jsx | 84 | |
| 108 | 'Add new note', | client/pages/admin/components/accounts/NoteForm.jsx | 84 | |
| 109 | React.createElement(Spinner, { | client/pages/admin/components/accounts/NoteForm.jsx | 84 | |
| 110 | space: 'left', | client/pages/admin/components/accounts/NoteForm.jsx | 88 | |
| 111 | show: this.props.data.loading | client/pages/admin/components/accounts/NoteForm.jsx | 89 | |
| 112 | }) | client/pages/admin/components/accounts/NoteForm.jsx | 89 | |
| 113 | ) | client/pages/admin/components/accounts/NoteForm.jsx | 90 | |
| 114 | ), | client/pages/admin/components/accounts/NoteForm.jsx | 91 | |
| 115 | React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 92 | |
| 116 | 'ul', | client/pages/admin/components/accounts/NoteForm.jsx | 93 | |
| 117 | { className: 'list-group list-group-notes' }, | client/pages/admin/components/accounts/NoteForm.jsx | 93 | |
| 118 | noteHistory | client/pages/admin/components/accounts/NoteForm.jsx | 93 | |
| 119 | ) | client/pages/admin/components/accounts/NoteForm.jsx | 94 | |
| 120 | ); | client/pages/admin/components/accounts/NoteForm.jsx | 95 | |
| 121 | } | client/pages/admin/components/accounts/NoteForm.jsx | 96 | |
| 122 | client/pages/admin/components/accounts/NoteForm.jsx | 97 | ||
| 123 | 19 | return React.createElement( | client/pages/admin/components/accounts/NoteForm.jsx | 99 |
| 124 | 'form', | client/pages/admin/components/accounts/NoteForm.jsx | 100 | |
| 125 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/accounts/NoteForm.jsx | 100 | |
| 126 | notice, | client/pages/admin/components/accounts/NoteForm.jsx | 100 | |
| 127 | formElements | client/pages/admin/components/accounts/NoteForm.jsx | 101 | |
| 128 | ); | client/pages/admin/components/accounts/NoteForm.jsx | 102 | |
| 129 | } | client/pages/admin/components/accounts/NoteForm.jsx | 104 | |
| 130 | }); | client/pages/admin/components/accounts/NoteForm.jsx | 105 | |
| 131 | client/pages/admin/components/accounts/NoteForm.jsx | 106 | ||
| 132 | 1 | module.exports = Component; | client/pages/admin/components/accounts/NoteForm.jsx | 109 |
| 133 | client/pages/admin/components/accounts/NoteForm.jsx | 109 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/accounts/Results.jsx | 1 | |
| 2 | client/pages/admin/components/accounts/Results.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/Results.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/accounts/Results.jsx | 2 |
| 5 | client/pages/admin/components/accounts/Results.jsx | 2 | ||
| 6 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/accounts/Results.jsx | 5 |
| 7 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/accounts/Results.jsx | 6 |
| 8 | client/pages/admin/components/accounts/Results.jsx | 6 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/Results.jsx | 9 |
| 10 | displayName: 'Component', | client/pages/admin/components/accounts/Results.jsx | 9 | |
| 11 | client/pages/admin/components/accounts/Results.jsx | 9 | ||
| 12 | mixins: [LinkedState], | client/pages/admin/components/accounts/Results.jsx | 10 | |
| 13 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/accounts/Results.jsx | 11 | |
| 14 | client/pages/admin/components/accounts/Results.jsx | 11 | ||
| 15 | 1 | return { | client/pages/admin/components/accounts/Results.jsx | 13 |
| 16 | data: [] | client/pages/admin/components/accounts/Results.jsx | 14 | |
| 17 | }; | client/pages/admin/components/accounts/Results.jsx | 14 | |
| 18 | }, | client/pages/admin/components/accounts/Results.jsx | 15 | |
| 19 | render: function render() { | client/pages/admin/components/accounts/Results.jsx | 17 | |
| 20 | client/pages/admin/components/accounts/Results.jsx | 17 | ||
| 21 | 16 | var rows = this.props.data.map(function (record) { | client/pages/admin/components/accounts/Results.jsx | 19 |
| 22 | client/pages/admin/components/accounts/Results.jsx | 19 | ||
| 23 | 2 | return React.createElement( | client/pages/admin/components/accounts/Results.jsx | 21 |
| 24 | 'tr', | client/pages/admin/components/accounts/Results.jsx | 22 | |
| 25 | { key: record._id }, | client/pages/admin/components/accounts/Results.jsx | 22 | |
| 26 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 22 | |
| 27 | 'td', | client/pages/admin/components/accounts/Results.jsx | 23 | |
| 28 | null, | client/pages/admin/components/accounts/Results.jsx | 23 | |
| 29 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 23 | |
| 30 | Link, | client/pages/admin/components/accounts/Results.jsx | 24 | |
| 31 | { | client/pages/admin/components/accounts/Results.jsx | 24 | |
| 32 | className: 'btn btn-default btn-sm', | client/pages/admin/components/accounts/Results.jsx | 25 | |
| 33 | to: 'accountDetails', | client/pages/admin/components/accounts/Results.jsx | 26 | |
| 34 | params: { id: record._id } }, | client/pages/admin/components/accounts/Results.jsx | 27 | |
| 35 | 'Edit' | client/pages/admin/components/accounts/Results.jsx | 27 | |
| 36 | ) | client/pages/admin/components/accounts/Results.jsx | 27 | |
| 37 | ), | client/pages/admin/components/accounts/Results.jsx | 30 | |
| 38 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 31 | |
| 39 | 'td', | client/pages/admin/components/accounts/Results.jsx | 32 | |
| 40 | null, | client/pages/admin/components/accounts/Results.jsx | 32 | |
| 41 | record.name.first, | client/pages/admin/components/accounts/Results.jsx | 32 | |
| 42 | ' ', | client/pages/admin/components/accounts/Results.jsx | 32 | |
| 43 | record.name.last | client/pages/admin/components/accounts/Results.jsx | 32 | |
| 44 | ), | client/pages/admin/components/accounts/Results.jsx | 32 | |
| 45 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 32 | |
| 46 | 'td', | client/pages/admin/components/accounts/Results.jsx | 33 | |
| 47 | null, | client/pages/admin/components/accounts/Results.jsx | 33 | |
| 48 | record._id | client/pages/admin/components/accounts/Results.jsx | 33 | |
| 49 | ) | client/pages/admin/components/accounts/Results.jsx | 33 | |
| 50 | ); | client/pages/admin/components/accounts/Results.jsx | 33 | |
| 51 | }); | client/pages/admin/components/accounts/Results.jsx | 35 | |
| 52 | client/pages/admin/components/accounts/Results.jsx | 36 | ||
| 53 | 16 | return React.createElement( | client/pages/admin/components/accounts/Results.jsx | 38 |
| 54 | 'div', | client/pages/admin/components/accounts/Results.jsx | 39 | |
| 55 | { className: 'table-responsive' }, | client/pages/admin/components/accounts/Results.jsx | 39 | |
| 56 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 39 | |
| 57 | 'table', | client/pages/admin/components/accounts/Results.jsx | 40 | |
| 58 | { className: 'table table-striped table-results' }, | client/pages/admin/components/accounts/Results.jsx | 40 | |
| 59 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 40 | |
| 60 | 'thead', | client/pages/admin/components/accounts/Results.jsx | 41 | |
| 61 | null, | client/pages/admin/components/accounts/Results.jsx | 41 | |
| 62 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 41 | |
| 63 | 'tr', | client/pages/admin/components/accounts/Results.jsx | 42 | |
| 64 | null, | client/pages/admin/components/accounts/Results.jsx | 42 | |
| 65 | React.createElement('th', null), | client/pages/admin/components/accounts/Results.jsx | 42 | |
| 66 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 43 | |
| 67 | 'th', | client/pages/admin/components/accounts/Results.jsx | 44 | |
| 68 | { className: 'stretch' }, | client/pages/admin/components/accounts/Results.jsx | 44 | |
| 69 | 'name' | client/pages/admin/components/accounts/Results.jsx | 44 | |
| 70 | ), | client/pages/admin/components/accounts/Results.jsx | 44 | |
| 71 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 44 | |
| 72 | 'th', | client/pages/admin/components/accounts/Results.jsx | 45 | |
| 73 | null, | client/pages/admin/components/accounts/Results.jsx | 45 | |
| 74 | 'id' | client/pages/admin/components/accounts/Results.jsx | 45 | |
| 75 | ) | client/pages/admin/components/accounts/Results.jsx | 45 | |
| 76 | ) | client/pages/admin/components/accounts/Results.jsx | 45 | |
| 77 | ), | client/pages/admin/components/accounts/Results.jsx | 46 | |
| 78 | React.createElement( | client/pages/admin/components/accounts/Results.jsx | 47 | |
| 79 | 'tbody', | client/pages/admin/components/accounts/Results.jsx | 48 | |
| 80 | null, | client/pages/admin/components/accounts/Results.jsx | 48 | |
| 81 | rows | client/pages/admin/components/accounts/Results.jsx | 48 | |
| 82 | ) | client/pages/admin/components/accounts/Results.jsx | 49 | |
| 83 | ) | client/pages/admin/components/accounts/Results.jsx | 50 | |
| 84 | ); | client/pages/admin/components/accounts/Results.jsx | 51 | |
| 85 | } | client/pages/admin/components/accounts/Results.jsx | 53 | |
| 86 | }); | client/pages/admin/components/accounts/Results.jsx | 54 | |
| 87 | client/pages/admin/components/accounts/Results.jsx | 55 | ||
| 88 | 1 | module.exports = Component; | client/pages/admin/components/accounts/Results.jsx | 58 |
| 89 | client/pages/admin/components/accounts/Results.jsx | 58 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/accounts/Search.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/accounts/Search.jsx | 2 | |
| 3 | client/pages/admin/components/accounts/Search.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/Search.jsx | 2 |
| 5 | 1 | var Paging = require('../../../../components/Paging'); | client/pages/admin/components/accounts/Search.jsx | 3 |
| 6 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/Search.jsx | 4 |
| 7 | 1 | var AccountStore = require('../../stores/Account'); | client/pages/admin/components/accounts/Search.jsx | 5 |
| 8 | 1 | var FilterForm = require('./FilterForm'); | client/pages/admin/components/accounts/Search.jsx | 6 |
| 9 | 1 | var CreateNewForm = require('./CreateNewForm'); | client/pages/admin/components/accounts/Search.jsx | 7 |
| 10 | 1 | var Results = require('./Results'); | client/pages/admin/components/accounts/Search.jsx | 8 |
| 11 | client/pages/admin/components/accounts/Search.jsx | 8 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/Search.jsx | 11 |
| 13 | displayName: 'Component', | client/pages/admin/components/accounts/Search.jsx | 11 | |
| 14 | client/pages/admin/components/accounts/Search.jsx | 11 | ||
| 15 | contextTypes: { | client/pages/admin/components/accounts/Search.jsx | 12 | |
| 16 | router: React.PropTypes.func | client/pages/admin/components/accounts/Search.jsx | 13 | |
| 17 | }, | client/pages/admin/components/accounts/Search.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/Search.jsx | 15 | |
| 19 | client/pages/admin/components/accounts/Search.jsx | 15 | ||
| 20 | 8 | AccountStore.resetResults(); | client/pages/admin/components/accounts/Search.jsx | 17 |
| 21 | 8 | AccountStore.resetCreateNew(); | client/pages/admin/components/accounts/Search.jsx | 18 |
| 22 | client/pages/admin/components/accounts/Search.jsx | 18 | ||
| 23 | 8 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/accounts/Search.jsx | 20 |
| 24 | client/pages/admin/components/accounts/Search.jsx | 20 | ||
| 25 | 8 | return { | client/pages/admin/components/accounts/Search.jsx | 22 |
| 26 | results: AccountStore.getResults(), | client/pages/admin/components/accounts/Search.jsx | 23 | |
| 27 | createNew: AccountStore.getCreateNew() | client/pages/admin/components/accounts/Search.jsx | 24 | |
| 28 | }; | client/pages/admin/components/accounts/Search.jsx | 24 | |
| 29 | }, | client/pages/admin/components/accounts/Search.jsx | 25 | |
| 30 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/accounts/Search.jsx | 27 | |
| 31 | client/pages/admin/components/accounts/Search.jsx | 27 | ||
| 32 | 1 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/accounts/Search.jsx | 29 |
| 33 | }, | client/pages/admin/components/accounts/Search.jsx | 29 | |
| 34 | componentDidMount: function componentDidMount() { | client/pages/admin/components/accounts/Search.jsx | 31 | |
| 35 | client/pages/admin/components/accounts/Search.jsx | 31 | ||
| 36 | 8 | AccountStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/accounts/Search.jsx | 33 |
| 37 | }, | client/pages/admin/components/accounts/Search.jsx | 33 | |
| 38 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/accounts/Search.jsx | 35 | |
| 39 | client/pages/admin/components/accounts/Search.jsx | 35 | ||
| 40 | 1 | AccountStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/accounts/Search.jsx | 37 |
| 41 | }, | client/pages/admin/components/accounts/Search.jsx | 37 | |
| 42 | onStoreChange: function onStoreChange() { | client/pages/admin/components/accounts/Search.jsx | 39 | |
| 43 | client/pages/admin/components/accounts/Search.jsx | 39 | ||
| 44 | 3 | this.setState({ | client/pages/admin/components/accounts/Search.jsx | 41 |
| 45 | results: AccountStore.getResults(), | client/pages/admin/components/accounts/Search.jsx | 42 | |
| 46 | createNew: AccountStore.getCreateNew() | client/pages/admin/components/accounts/Search.jsx | 43 | |
| 47 | }); | client/pages/admin/components/accounts/Search.jsx | 43 | |
| 48 | }, | client/pages/admin/components/accounts/Search.jsx | 44 | |
| 49 | onFiltersChange: function onFiltersChange(event) { | client/pages/admin/components/accounts/Search.jsx | 46 | |
| 50 | client/pages/admin/components/accounts/Search.jsx | 46 | ||
| 51 | 3 | if (event) { | client/pages/admin/components/accounts/Search.jsx | 48 |
| 52 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/Search.jsx | 49 |
| 53 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/Search.jsx | 50 |
| 54 | } | client/pages/admin/components/accounts/Search.jsx | 50 | |
| 55 | client/pages/admin/components/accounts/Search.jsx | 51 | ||
| 56 | 3 | this.context.router.transitionTo('accounts', {}, this.refs.filters.state); | client/pages/admin/components/accounts/Search.jsx | 53 |
| 57 | 3 | window.scrollTo(0, 0); | client/pages/admin/components/accounts/Search.jsx | 54 |
| 58 | }, | client/pages/admin/components/accounts/Search.jsx | 54 | |
| 59 | onPageChange: function onPageChange(page) { | client/pages/admin/components/accounts/Search.jsx | 56 | |
| 60 | client/pages/admin/components/accounts/Search.jsx | 56 | ||
| 61 | 1 | this.refs.filters.changePage(page); | client/pages/admin/components/accounts/Search.jsx | 58 |
| 62 | }, | client/pages/admin/components/accounts/Search.jsx | 58 | |
| 63 | onNewClick: function onNewClick() { | client/pages/admin/components/accounts/Search.jsx | 60 | |
| 64 | client/pages/admin/components/accounts/Search.jsx | 60 | ||
| 65 | 1 | Actions.showCreateNew(); | client/pages/admin/components/accounts/Search.jsx | 62 |
| 66 | }, | client/pages/admin/components/accounts/Search.jsx | 62 | |
| 67 | render: function render() { | client/pages/admin/components/accounts/Search.jsx | 64 | |
| 68 | client/pages/admin/components/accounts/Search.jsx | 64 | ||
| 69 | 13 | return React.createElement( | client/pages/admin/components/accounts/Search.jsx | 66 |
| 70 | 'section', | client/pages/admin/components/accounts/Search.jsx | 67 | |
| 71 | { className: 'section-accounts container' }, | client/pages/admin/components/accounts/Search.jsx | 67 | |
| 72 | React.createElement( | client/pages/admin/components/accounts/Search.jsx | 67 | |
| 73 | 'div', | client/pages/admin/components/accounts/Search.jsx | 68 | |
| 74 | { className: 'page-header' }, | client/pages/admin/components/accounts/Search.jsx | 68 | |
| 75 | React.createElement( | client/pages/admin/components/accounts/Search.jsx | 68 | |
| 76 | 'button', | client/pages/admin/components/accounts/Search.jsx | 69 | |
| 77 | { | client/pages/admin/components/accounts/Search.jsx | 69 | |
| 78 | ref: 'createNew', | client/pages/admin/components/accounts/Search.jsx | 70 | |
| 79 | className: 'btn btn-default pull-right', | client/pages/admin/components/accounts/Search.jsx | 71 | |
| 80 | onClick: this.onNewClick }, | client/pages/admin/components/accounts/Search.jsx | 72 | |
| 81 | 'Create new' | client/pages/admin/components/accounts/Search.jsx | 72 | |
| 82 | ), | client/pages/admin/components/accounts/Search.jsx | 72 | |
| 83 | React.createElement( | client/pages/admin/components/accounts/Search.jsx | 75 | |
| 84 | 'h1', | client/pages/admin/components/accounts/Search.jsx | 76 | |
| 85 | null, | client/pages/admin/components/accounts/Search.jsx | 76 | |
| 86 | 'Accounts' | client/pages/admin/components/accounts/Search.jsx | 76 | |
| 87 | ) | client/pages/admin/components/accounts/Search.jsx | 76 | |
| 88 | ), | client/pages/admin/components/accounts/Search.jsx | 76 | |
| 89 | React.createElement(FilterForm, { | client/pages/admin/components/accounts/Search.jsx | 77 | |
| 90 | ref: 'filters', | client/pages/admin/components/accounts/Search.jsx | 79 | |
| 91 | query: this.context.router.getCurrentQuery(), | client/pages/admin/components/accounts/Search.jsx | 80 | |
| 92 | loading: this.state.results.loading, | client/pages/admin/components/accounts/Search.jsx | 81 | |
| 93 | onChange: this.onFiltersChange | client/pages/admin/components/accounts/Search.jsx | 82 | |
| 94 | }), | client/pages/admin/components/accounts/Search.jsx | 82 | |
| 95 | React.createElement(Results, { data: this.state.results.data }), | client/pages/admin/components/accounts/Search.jsx | 83 | |
| 96 | React.createElement(Paging, { | client/pages/admin/components/accounts/Search.jsx | 84 | |
| 97 | ref: 'paging', | client/pages/admin/components/accounts/Search.jsx | 86 | |
| 98 | pages: this.state.results.pages, | client/pages/admin/components/accounts/Search.jsx | 87 | |
| 99 | items: this.state.results.items, | client/pages/admin/components/accounts/Search.jsx | 88 | |
| 100 | loading: this.state.results.loading, | client/pages/admin/components/accounts/Search.jsx | 89 | |
| 101 | onChange: this.onPageChange | client/pages/admin/components/accounts/Search.jsx | 90 | |
| 102 | }), | client/pages/admin/components/accounts/Search.jsx | 90 | |
| 103 | React.createElement(CreateNewForm, { data: this.state.createNew }) | client/pages/admin/components/accounts/Search.jsx | 91 | |
| 104 | ); | client/pages/admin/components/accounts/Search.jsx | 92 | |
| 105 | } | client/pages/admin/components/accounts/Search.jsx | 94 | |
| 106 | }); | client/pages/admin/components/accounts/Search.jsx | 95 | |
| 107 | client/pages/admin/components/accounts/Search.jsx | 96 | ||
| 108 | 1 | module.exports = Component; | client/pages/admin/components/accounts/Search.jsx | 99 |
| 109 | client/pages/admin/components/accounts/Search.jsx | 99 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/accounts/StatusForm.jsx | 1 | |
| 2 | client/pages/admin/components/accounts/StatusForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/StatusForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/accounts/StatusForm.jsx | 2 |
| 5 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/accounts/StatusForm.jsx | 3 |
| 6 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/StatusForm.jsx | 4 |
| 7 | client/pages/admin/components/accounts/StatusForm.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/StatusForm.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/accounts/StatusForm.jsx | 7 | |
| 10 | client/pages/admin/components/accounts/StatusForm.jsx | 7 | ||
| 11 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/accounts/StatusForm.jsx | 8 | |
| 12 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/StatusForm.jsx | 9 | |
| 13 | client/pages/admin/components/accounts/StatusForm.jsx | 9 | ||
| 14 | 13 | return {}; | client/pages/admin/components/accounts/StatusForm.jsx | 11 |
| 15 | }, | client/pages/admin/components/accounts/StatusForm.jsx | 11 | |
| 16 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/accounts/StatusForm.jsx | 13 | |
| 17 | client/pages/admin/components/accounts/StatusForm.jsx | 13 | ||
| 18 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/accounts/StatusForm.jsx | 15 |
| 19 | 5 | this.setState({ | client/pages/admin/components/accounts/StatusForm.jsx | 16 |
| 20 | hydrated: nextProps.details.hydrated, | client/pages/admin/components/accounts/StatusForm.jsx | 17 | |
| 21 | newStatus: nextProps.details.status.current.id | client/pages/admin/components/accounts/StatusForm.jsx | 18 | |
| 22 | }); | client/pages/admin/components/accounts/StatusForm.jsx | 18 | |
| 23 | } | client/pages/admin/components/accounts/StatusForm.jsx | 19 | |
| 24 | }, | client/pages/admin/components/accounts/StatusForm.jsx | 20 | |
| 25 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/accounts/StatusForm.jsx | 22 | |
| 26 | client/pages/admin/components/accounts/StatusForm.jsx | 22 | ||
| 27 | 3 | clearTimeout(this.timeout); | client/pages/admin/components/accounts/StatusForm.jsx | 24 |
| 28 | }, | client/pages/admin/components/accounts/StatusForm.jsx | 24 | |
| 29 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/accounts/StatusForm.jsx | 26 | |
| 30 | client/pages/admin/components/accounts/StatusForm.jsx | 26 | ||
| 31 | 2 | event.preventDefault(); | client/pages/admin/components/accounts/StatusForm.jsx | 28 |
| 32 | 2 | event.stopPropagation(); | client/pages/admin/components/accounts/StatusForm.jsx | 29 |
| 33 | client/pages/admin/components/accounts/StatusForm.jsx | 29 | ||
| 34 | 2 | if (this.state.newStatus === this.props.details.status.current.id) { | client/pages/admin/components/accounts/StatusForm.jsx | 31 |
| 35 | 1 | this.setState({ | client/pages/admin/components/accounts/StatusForm.jsx | 32 |
| 36 | error: 'That is the current status.' | client/pages/admin/components/accounts/StatusForm.jsx | 33 | |
| 37 | }); | client/pages/admin/components/accounts/StatusForm.jsx | 33 | |
| 38 | client/pages/admin/components/accounts/StatusForm.jsx | 34 | ||
| 39 | 1 | this.timeout = setTimeout((function () { | client/pages/admin/components/accounts/StatusForm.jsx | 36 |
| 40 | client/pages/admin/components/accounts/StatusForm.jsx | 36 | ||
| 41 | 1 | this.setState({ error: undefined }); | client/pages/admin/components/accounts/StatusForm.jsx | 38 |
| 42 | }).bind(this), 2500); | client/pages/admin/components/accounts/StatusForm.jsx | 38 | |
| 43 | client/pages/admin/components/accounts/StatusForm.jsx | 39 | ||
| 44 | 1 | return; | client/pages/admin/components/accounts/StatusForm.jsx | 41 |
| 45 | } | client/pages/admin/components/accounts/StatusForm.jsx | 41 | |
| 46 | client/pages/admin/components/accounts/StatusForm.jsx | 42 | ||
| 47 | 1 | Actions.newStatus({ | client/pages/admin/components/accounts/StatusForm.jsx | 44 |
| 48 | id: this.props.details._id, | client/pages/admin/components/accounts/StatusForm.jsx | 45 | |
| 49 | status: this.state.newStatus | client/pages/admin/components/accounts/StatusForm.jsx | 46 | |
| 50 | }); | client/pages/admin/components/accounts/StatusForm.jsx | 46 | |
| 51 | }, | client/pages/admin/components/accounts/StatusForm.jsx | 47 | |
| 52 | render: function render() { | client/pages/admin/components/accounts/StatusForm.jsx | 49 | |
| 53 | client/pages/admin/components/accounts/StatusForm.jsx | 49 | ||
| 54 | 22 | var alerts = []; | client/pages/admin/components/accounts/StatusForm.jsx | 51 |
| 55 | 22 | var error = this.props.data.error || this.state.error; | client/pages/admin/components/accounts/StatusForm.jsx | 52 |
| 56 | 22 | if (this.props.data.success) { | client/pages/admin/components/accounts/StatusForm.jsx | 53 |
| 57 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 54 |
| 58 | 'div', | client/pages/admin/components/accounts/StatusForm.jsx | 54 | |
| 59 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/accounts/StatusForm.jsx | 54 | |
| 60 | 'Success. Changes have been saved.' | client/pages/admin/components/accounts/StatusForm.jsx | 54 | |
| 61 | )); | client/pages/admin/components/accounts/StatusForm.jsx | 54 | |
| 62 | 21 | } else if (error) { | client/pages/admin/components/accounts/StatusForm.jsx | 56 |
| 63 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 59 |
| 64 | 'div', | client/pages/admin/components/accounts/StatusForm.jsx | 59 | |
| 65 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/accounts/StatusForm.jsx | 59 | |
| 66 | error | client/pages/admin/components/accounts/StatusForm.jsx | 59 | |
| 67 | )); | client/pages/admin/components/accounts/StatusForm.jsx | 60 | |
| 68 | } | client/pages/admin/components/accounts/StatusForm.jsx | 61 | |
| 69 | client/pages/admin/components/accounts/StatusForm.jsx | 62 | ||
| 70 | 22 | var notice; | client/pages/admin/components/accounts/StatusForm.jsx | 64 |
| 71 | 22 | if (!this.props.details.hydrated) { | client/pages/admin/components/accounts/StatusForm.jsx | 65 |
| 72 | 11 | notice = React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 66 |
| 73 | 'div', | client/pages/admin/components/accounts/StatusForm.jsx | 66 | |
| 74 | { className: 'alert alert-info' }, | client/pages/admin/components/accounts/StatusForm.jsx | 66 | |
| 75 | 'Loading data...' | client/pages/admin/components/accounts/StatusForm.jsx | 66 | |
| 76 | ); | client/pages/admin/components/accounts/StatusForm.jsx | 66 | |
| 77 | } | client/pages/admin/components/accounts/StatusForm.jsx | 68 | |
| 78 | client/pages/admin/components/accounts/StatusForm.jsx | 69 | ||
| 79 | 22 | var formElements; | client/pages/admin/components/accounts/StatusForm.jsx | 71 |
| 80 | 22 | if (this.props.details.hydrated) { | client/pages/admin/components/accounts/StatusForm.jsx | 72 |
| 81 | 11 | var statuses = this.props.list.data; | client/pages/admin/components/accounts/StatusForm.jsx | 73 |
| 82 | 11 | var statusOptions = statuses.map(function (status) { | client/pages/admin/components/accounts/StatusForm.jsx | 74 |
| 83 | client/pages/admin/components/accounts/StatusForm.jsx | 74 | ||
| 84 | 22 | return React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 76 |
| 85 | 'option', | client/pages/admin/components/accounts/StatusForm.jsx | 77 | |
| 86 | { key: status._id, value: status._id }, | client/pages/admin/components/accounts/StatusForm.jsx | 77 | |
| 87 | status.name | client/pages/admin/components/accounts/StatusForm.jsx | 77 | |
| 88 | ); | client/pages/admin/components/accounts/StatusForm.jsx | 78 | |
| 89 | }); | client/pages/admin/components/accounts/StatusForm.jsx | 80 | |
| 90 | client/pages/admin/components/accounts/StatusForm.jsx | 81 | ||
| 91 | 11 | var statusData = this.props.details.status; | client/pages/admin/components/accounts/StatusForm.jsx | 83 |
| 92 | 11 | var history = statusData.log || []; | client/pages/admin/components/accounts/StatusForm.jsx | 84 |
| 93 | 11 | var statusHistory = history.map(function (status) { | client/pages/admin/components/accounts/StatusForm.jsx | 85 |
| 94 | client/pages/admin/components/accounts/StatusForm.jsx | 85 | ||
| 95 | 1 | return React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 87 |
| 96 | 'li', | client/pages/admin/components/accounts/StatusForm.jsx | 88 | |
| 97 | { key: status.timeCreated, className: 'list-group-item' }, | client/pages/admin/components/accounts/StatusForm.jsx | 88 | |
| 98 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 88 | |
| 99 | 'span', | client/pages/admin/components/accounts/StatusForm.jsx | 89 | |
| 100 | { | client/pages/admin/components/accounts/StatusForm.jsx | 89 | |
| 101 | title: status.moment.toString(), | client/pages/admin/components/accounts/StatusForm.jsx | 90 | |
| 102 | className: 'badge pull-right' }, | client/pages/admin/components/accounts/StatusForm.jsx | 91 | |
| 103 | status.userCreated.name, | client/pages/admin/components/accounts/StatusForm.jsx | 91 | |
| 104 | ' - ', | client/pages/admin/components/accounts/StatusForm.jsx | 93 | |
| 105 | status.moment.fromNow() | client/pages/admin/components/accounts/StatusForm.jsx | 93 | |
| 106 | ), | client/pages/admin/components/accounts/StatusForm.jsx | 93 | |
| 107 | status.name | client/pages/admin/components/accounts/StatusForm.jsx | 94 | |
| 108 | ); | client/pages/admin/components/accounts/StatusForm.jsx | 95 | |
| 109 | }); | client/pages/admin/components/accounts/StatusForm.jsx | 97 | |
| 110 | client/pages/admin/components/accounts/StatusForm.jsx | 98 | ||
| 111 | 11 | formElements = React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 100 |
| 112 | 'fieldset', | client/pages/admin/components/accounts/StatusForm.jsx | 100 | |
| 113 | null, | client/pages/admin/components/accounts/StatusForm.jsx | 100 | |
| 114 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 100 | |
| 115 | 'legend', | client/pages/admin/components/accounts/StatusForm.jsx | 101 | |
| 116 | null, | client/pages/admin/components/accounts/StatusForm.jsx | 101 | |
| 117 | 'Status' | client/pages/admin/components/accounts/StatusForm.jsx | 101 | |
| 118 | ), | client/pages/admin/components/accounts/StatusForm.jsx | 101 | |
| 119 | alerts, | client/pages/admin/components/accounts/StatusForm.jsx | 101 | |
| 120 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 102 | |
| 121 | ControlGroup, | client/pages/admin/components/accounts/StatusForm.jsx | 103 | |
| 122 | { | client/pages/admin/components/accounts/StatusForm.jsx | 103 | |
| 123 | hideLabel: true, | client/pages/admin/components/accounts/StatusForm.jsx | 104 | |
| 124 | hasError: this.props.data.hasError.status, | client/pages/admin/components/accounts/StatusForm.jsx | 105 | |
| 125 | help: this.props.data.help.status }, | client/pages/admin/components/accounts/StatusForm.jsx | 106 | |
| 126 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 106 | |
| 127 | 'div', | client/pages/admin/components/accounts/StatusForm.jsx | 108 | |
| 128 | { className: 'input-group' }, | client/pages/admin/components/accounts/StatusForm.jsx | 108 | |
| 129 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 108 | |
| 130 | 'select', | client/pages/admin/components/accounts/StatusForm.jsx | 109 | |
| 131 | { | client/pages/admin/components/accounts/StatusForm.jsx | 109 | |
| 132 | ref: 'newStatus', | client/pages/admin/components/accounts/StatusForm.jsx | 110 | |
| 133 | name: 'newStatus', | client/pages/admin/components/accounts/StatusForm.jsx | 111 | |
| 134 | className: 'form-control', | client/pages/admin/components/accounts/StatusForm.jsx | 112 | |
| 135 | valueLink: this.linkState('newStatus') }, | client/pages/admin/components/accounts/StatusForm.jsx | 113 | |
| 136 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 113 | |
| 137 | 'option', | client/pages/admin/components/accounts/StatusForm.jsx | 115 | |
| 138 | { value: '' }, | client/pages/admin/components/accounts/StatusForm.jsx | 115 | |
| 139 | '--- select ---' | client/pages/admin/components/accounts/StatusForm.jsx | 115 | |
| 140 | ), | client/pages/admin/components/accounts/StatusForm.jsx | 115 | |
| 141 | statusOptions | client/pages/admin/components/accounts/StatusForm.jsx | 115 | |
| 142 | ), | client/pages/admin/components/accounts/StatusForm.jsx | 116 | |
| 143 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 117 | |
| 144 | 'span', | client/pages/admin/components/accounts/StatusForm.jsx | 118 | |
| 145 | { className: 'input-group-btn' }, | client/pages/admin/components/accounts/StatusForm.jsx | 118 | |
| 146 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 118 | |
| 147 | 'button', | client/pages/admin/components/accounts/StatusForm.jsx | 119 | |
| 148 | { | client/pages/admin/components/accounts/StatusForm.jsx | 119 | |
| 149 | ref: 'newStatusButton', | client/pages/admin/components/accounts/StatusForm.jsx | 120 | |
| 150 | type: 'submit', | client/pages/admin/components/accounts/StatusForm.jsx | 121 | |
| 151 | className: 'btn btn-default' }, | client/pages/admin/components/accounts/StatusForm.jsx | 122 | |
| 152 | 'Change', | client/pages/admin/components/accounts/StatusForm.jsx | 122 | |
| 153 | React.createElement(Spinner, { | client/pages/admin/components/accounts/StatusForm.jsx | 122 | |
| 154 | space: 'left', | client/pages/admin/components/accounts/StatusForm.jsx | 126 | |
| 155 | show: this.props.data.loading | client/pages/admin/components/accounts/StatusForm.jsx | 127 | |
| 156 | }) | client/pages/admin/components/accounts/StatusForm.jsx | 127 | |
| 157 | ) | client/pages/admin/components/accounts/StatusForm.jsx | 128 | |
| 158 | ) | client/pages/admin/components/accounts/StatusForm.jsx | 129 | |
| 159 | ) | client/pages/admin/components/accounts/StatusForm.jsx | 130 | |
| 160 | ), | client/pages/admin/components/accounts/StatusForm.jsx | 131 | |
| 161 | React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 132 | |
| 162 | 'ul', | client/pages/admin/components/accounts/StatusForm.jsx | 133 | |
| 163 | { className: 'list-group list-group-statuses' }, | client/pages/admin/components/accounts/StatusForm.jsx | 133 | |
| 164 | statusHistory | client/pages/admin/components/accounts/StatusForm.jsx | 133 | |
| 165 | ) | client/pages/admin/components/accounts/StatusForm.jsx | 134 | |
| 166 | ); | client/pages/admin/components/accounts/StatusForm.jsx | 135 | |
| 167 | } | client/pages/admin/components/accounts/StatusForm.jsx | 136 | |
| 168 | client/pages/admin/components/accounts/StatusForm.jsx | 137 | ||
| 169 | 22 | return React.createElement( | client/pages/admin/components/accounts/StatusForm.jsx | 139 |
| 170 | 'form', | client/pages/admin/components/accounts/StatusForm.jsx | 140 | |
| 171 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/accounts/StatusForm.jsx | 140 | |
| 172 | notice, | client/pages/admin/components/accounts/StatusForm.jsx | 140 | |
| 173 | formElements | client/pages/admin/components/accounts/StatusForm.jsx | 141 | |
| 174 | ); | client/pages/admin/components/accounts/StatusForm.jsx | 142 | |
| 175 | } | client/pages/admin/components/accounts/StatusForm.jsx | 144 | |
| 176 | }); | client/pages/admin/components/accounts/StatusForm.jsx | 145 | |
| 177 | client/pages/admin/components/accounts/StatusForm.jsx | 146 | ||
| 178 | 1 | module.exports = Component; | client/pages/admin/components/accounts/StatusForm.jsx | 149 |
| 179 | client/pages/admin/components/accounts/StatusForm.jsx | 149 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/accounts/UserForm.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/accounts/UserForm.jsx | 2 | |
| 3 | client/pages/admin/components/accounts/UserForm.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/accounts/UserForm.jsx | 2 |
| 5 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/accounts/UserForm.jsx | 3 |
| 6 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/accounts/UserForm.jsx | 4 |
| 7 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/accounts/UserForm.jsx | 5 |
| 8 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/accounts/UserForm.jsx | 6 |
| 9 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/accounts/UserForm.jsx | 7 |
| 10 | 1 | var Actions = require('../../actions/Account'); | client/pages/admin/components/accounts/UserForm.jsx | 8 |
| 11 | client/pages/admin/components/accounts/UserForm.jsx | 8 | ||
| 12 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/accounts/UserForm.jsx | 11 |
| 13 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/accounts/UserForm.jsx | 12 |
| 14 | client/pages/admin/components/accounts/UserForm.jsx | 12 | ||
| 15 | 1 | var Component = React.createClass({ | client/pages/admin/components/accounts/UserForm.jsx | 15 |
| 16 | displayName: 'Component', | client/pages/admin/components/accounts/UserForm.jsx | 15 | |
| 17 | client/pages/admin/components/accounts/UserForm.jsx | 15 | ||
| 18 | mixins: [LinkedState], | client/pages/admin/components/accounts/UserForm.jsx | 16 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/accounts/UserForm.jsx | 17 | |
| 20 | client/pages/admin/components/accounts/UserForm.jsx | 17 | ||
| 21 | 13 | return {}; | client/pages/admin/components/accounts/UserForm.jsx | 19 |
| 22 | }, | client/pages/admin/components/accounts/UserForm.jsx | 19 | |
| 23 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/accounts/UserForm.jsx | 21 | |
| 24 | client/pages/admin/components/accounts/UserForm.jsx | 21 | ||
| 25 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/accounts/UserForm.jsx | 23 |
| 26 | 5 | this.setState({ | client/pages/admin/components/accounts/UserForm.jsx | 24 |
| 27 | hydrated: nextProps.details.hydrated, | client/pages/admin/components/accounts/UserForm.jsx | 25 | |
| 28 | user: nextProps.details.user | client/pages/admin/components/accounts/UserForm.jsx | 26 | |
| 29 | }); | client/pages/admin/components/accounts/UserForm.jsx | 26 | |
| 30 | } | client/pages/admin/components/accounts/UserForm.jsx | 27 | |
| 31 | }, | client/pages/admin/components/accounts/UserForm.jsx | 28 | |
| 32 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/accounts/UserForm.jsx | 30 | |
| 33 | client/pages/admin/components/accounts/UserForm.jsx | 30 | ||
| 34 | 2 | event.preventDefault(); | client/pages/admin/components/accounts/UserForm.jsx | 32 |
| 35 | 2 | event.stopPropagation(); | client/pages/admin/components/accounts/UserForm.jsx | 33 |
| 36 | client/pages/admin/components/accounts/UserForm.jsx | 33 | ||
| 37 | 2 | if (this.props.details.user) { | client/pages/admin/components/accounts/UserForm.jsx | 35 |
| 38 | 1 | Actions.unlinkUser({ | client/pages/admin/components/accounts/UserForm.jsx | 36 |
| 39 | id: this.props.details._id | client/pages/admin/components/accounts/UserForm.jsx | 37 | |
| 40 | }); | client/pages/admin/components/accounts/UserForm.jsx | 37 | |
| 41 | client/pages/admin/components/accounts/UserForm.jsx | 38 | ||
| 42 | 1 | this.setState({ username: '' }); | client/pages/admin/components/accounts/UserForm.jsx | 40 |
| 43 | } else { | client/pages/admin/components/accounts/UserForm.jsx | 40 | |
| 44 | 1 | Actions.linkUser({ | client/pages/admin/components/accounts/UserForm.jsx | 43 |
| 45 | id: this.props.details._id, | client/pages/admin/components/accounts/UserForm.jsx | 44 | |
| 46 | username: this.state.username | client/pages/admin/components/accounts/UserForm.jsx | 45 | |
| 47 | }); | client/pages/admin/components/accounts/UserForm.jsx | 45 | |
| 48 | } | client/pages/admin/components/accounts/UserForm.jsx | 46 | |
| 49 | }, | client/pages/admin/components/accounts/UserForm.jsx | 47 | |
| 50 | onConfirm: function onConfirm(event) { | client/pages/admin/components/accounts/UserForm.jsx | 49 | |
| 51 | client/pages/admin/components/accounts/UserForm.jsx | 49 | ||
| 52 | 2 | if (!window.confirm('Are you sure?')) { | client/pages/admin/components/accounts/UserForm.jsx | 51 |
| 53 | 1 | event.preventDefault(); | client/pages/admin/components/accounts/UserForm.jsx | 52 |
| 54 | 1 | event.stopPropagation(); | client/pages/admin/components/accounts/UserForm.jsx | 53 |
| 55 | } | client/pages/admin/components/accounts/UserForm.jsx | 53 | |
| 56 | }, | client/pages/admin/components/accounts/UserForm.jsx | 54 | |
| 57 | render: function render() { | client/pages/admin/components/accounts/UserForm.jsx | 56 | |
| 58 | client/pages/admin/components/accounts/UserForm.jsx | 56 | ||
| 59 | 20 | var alerts = []; | client/pages/admin/components/accounts/UserForm.jsx | 58 |
| 60 | 20 | if (this.props.data.success) { | client/pages/admin/components/accounts/UserForm.jsx | 59 |
| 61 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 60 |
| 62 | 'div', | client/pages/admin/components/accounts/UserForm.jsx | 60 | |
| 63 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/accounts/UserForm.jsx | 60 | |
| 64 | 'Success. Changes have been saved.' | client/pages/admin/components/accounts/UserForm.jsx | 60 | |
| 65 | )); | client/pages/admin/components/accounts/UserForm.jsx | 60 | |
| 66 | 19 | } else if (this.props.data.error) { | client/pages/admin/components/accounts/UserForm.jsx | 62 |
| 67 | 1 | alerts.push(React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 65 |
| 68 | 'div', | client/pages/admin/components/accounts/UserForm.jsx | 65 | |
| 69 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/accounts/UserForm.jsx | 65 | |
| 70 | this.props.data.error | client/pages/admin/components/accounts/UserForm.jsx | 65 | |
| 71 | )); | client/pages/admin/components/accounts/UserForm.jsx | 66 | |
| 72 | } | client/pages/admin/components/accounts/UserForm.jsx | 67 | |
| 73 | client/pages/admin/components/accounts/UserForm.jsx | 68 | ||
| 74 | 20 | var notice; | client/pages/admin/components/accounts/UserForm.jsx | 70 |
| 75 | 20 | if (!this.props.details.hydrated) { | client/pages/admin/components/accounts/UserForm.jsx | 71 |
| 76 | 14 | notice = React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 72 |
| 77 | 'div', | client/pages/admin/components/accounts/UserForm.jsx | 72 | |
| 78 | { className: 'alert alert-info' }, | client/pages/admin/components/accounts/UserForm.jsx | 72 | |
| 79 | 'Loading data...' | client/pages/admin/components/accounts/UserForm.jsx | 72 | |
| 80 | ); | client/pages/admin/components/accounts/UserForm.jsx | 72 | |
| 81 | } | client/pages/admin/components/accounts/UserForm.jsx | 74 | |
| 82 | client/pages/admin/components/accounts/UserForm.jsx | 75 | ||
| 83 | 20 | var formElements; | client/pages/admin/components/accounts/UserForm.jsx | 77 |
| 84 | 20 | if (this.props.details.hydrated) { | client/pages/admin/components/accounts/UserForm.jsx | 78 |
| 85 | 6 | var isLinked = Boolean(this.props.details.user); | client/pages/admin/components/accounts/UserForm.jsx | 79 |
| 86 | client/pages/admin/components/accounts/UserForm.jsx | 79 | ||
| 87 | 6 | var username; | client/pages/admin/components/accounts/UserForm.jsx | 81 |
| 88 | 6 | if (isLinked) { | client/pages/admin/components/accounts/UserForm.jsx | 82 |
| 89 | 2 | username = React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 83 |
| 90 | ControlGroup, | client/pages/admin/components/accounts/UserForm.jsx | 83 | |
| 91 | { label: 'Username' }, | client/pages/admin/components/accounts/UserForm.jsx | 83 | |
| 92 | React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 83 | |
| 93 | 'div', | client/pages/admin/components/accounts/UserForm.jsx | 84 | |
| 94 | { className: 'input-group' }, | client/pages/admin/components/accounts/UserForm.jsx | 84 | |
| 95 | React.createElement('input', { | client/pages/admin/components/accounts/UserForm.jsx | 84 | |
| 96 | type: 'text', | client/pages/admin/components/accounts/UserForm.jsx | 86 | |
| 97 | className: 'form-control', | client/pages/admin/components/accounts/UserForm.jsx | 87 | |
| 98 | disabled: true, | client/pages/admin/components/accounts/UserForm.jsx | 88 | |
| 99 | value: this.props.details.user.name | client/pages/admin/components/accounts/UserForm.jsx | 89 | |
| 100 | }), | client/pages/admin/components/accounts/UserForm.jsx | 89 | |
| 101 | React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 90 | |
| 102 | 'span', | client/pages/admin/components/accounts/UserForm.jsx | 91 | |
| 103 | { className: 'input-group-btn' }, | client/pages/admin/components/accounts/UserForm.jsx | 91 | |
| 104 | React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 91 | |
| 105 | Link, | client/pages/admin/components/accounts/UserForm.jsx | 92 | |
| 106 | { | client/pages/admin/components/accounts/UserForm.jsx | 92 | |
| 107 | to: 'userDetails', | client/pages/admin/components/accounts/UserForm.jsx | 93 | |
| 108 | params: { id: this.props.details.user.id }, | client/pages/admin/components/accounts/UserForm.jsx | 94 | |
| 109 | className: 'btn btn-default' }, | client/pages/admin/components/accounts/UserForm.jsx | 95 | |
| 110 | 'View' | client/pages/admin/components/accounts/UserForm.jsx | 95 | |
| 111 | ) | client/pages/admin/components/accounts/UserForm.jsx | 95 | |
| 112 | ) | client/pages/admin/components/accounts/UserForm.jsx | 98 | |
| 113 | ) | client/pages/admin/components/accounts/UserForm.jsx | 99 | |
| 114 | ); | client/pages/admin/components/accounts/UserForm.jsx | 100 | |
| 115 | } else { | client/pages/admin/components/accounts/UserForm.jsx | 101 | |
| 116 | 4 | username = React.createElement(TextControl, { | client/pages/admin/components/accounts/UserForm.jsx | 104 |
| 117 | name: 'username', | client/pages/admin/components/accounts/UserForm.jsx | 105 | |
| 118 | label: 'Username', | client/pages/admin/components/accounts/UserForm.jsx | 106 | |
| 119 | hasError: this.props.data.hasError.username, | client/pages/admin/components/accounts/UserForm.jsx | 107 | |
| 120 | valueLink: this.linkState('username'), | client/pages/admin/components/accounts/UserForm.jsx | 108 | |
| 121 | help: this.props.data.help.username, | client/pages/admin/components/accounts/UserForm.jsx | 109 | |
| 122 | disabled: this.props.data.loading | client/pages/admin/components/accounts/UserForm.jsx | 110 | |
| 123 | }); | client/pages/admin/components/accounts/UserForm.jsx | 110 | |
| 124 | } | client/pages/admin/components/accounts/UserForm.jsx | 111 | |
| 125 | client/pages/admin/components/accounts/UserForm.jsx | 112 | ||
| 126 | 6 | formElements = React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 114 |
| 127 | 'fieldset', | client/pages/admin/components/accounts/UserForm.jsx | 114 | |
| 128 | null, | client/pages/admin/components/accounts/UserForm.jsx | 114 | |
| 129 | React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 114 | |
| 130 | 'legend', | client/pages/admin/components/accounts/UserForm.jsx | 115 | |
| 131 | null, | client/pages/admin/components/accounts/UserForm.jsx | 115 | |
| 132 | 'User' | client/pages/admin/components/accounts/UserForm.jsx | 115 | |
| 133 | ), | client/pages/admin/components/accounts/UserForm.jsx | 115 | |
| 134 | alerts, | client/pages/admin/components/accounts/UserForm.jsx | 115 | |
| 135 | username, | client/pages/admin/components/accounts/UserForm.jsx | 116 | |
| 136 | React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 117 | |
| 137 | ControlGroup, | client/pages/admin/components/accounts/UserForm.jsx | 118 | |
| 138 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/accounts/UserForm.jsx | 118 | |
| 139 | React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 118 | |
| 140 | Button, | client/pages/admin/components/accounts/UserForm.jsx | 119 | |
| 141 | { | client/pages/admin/components/accounts/UserForm.jsx | 119 | |
| 142 | type: 'submit', | client/pages/admin/components/accounts/UserForm.jsx | 120 | |
| 143 | inputClasses: { | client/pages/admin/components/accounts/UserForm.jsx | 121 | |
| 144 | 'btn-primary': !isLinked, | client/pages/admin/components/accounts/UserForm.jsx | 122 | |
| 145 | 'btn-danger': isLinked | client/pages/admin/components/accounts/UserForm.jsx | 123 | |
| 146 | }, | client/pages/admin/components/accounts/UserForm.jsx | 123 | |
| 147 | onClick: isLinked ? this.onConfirm : undefined, | client/pages/admin/components/accounts/UserForm.jsx | 125 | |
| 148 | disabled: this.props.data.loading }, | client/pages/admin/components/accounts/UserForm.jsx | 126 | |
| 149 | isLinked ? 'Unlink user' : 'Link user', | client/pages/admin/components/accounts/UserForm.jsx | 126 | |
| 150 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/accounts/UserForm.jsx | 128 | |
| 151 | ) | client/pages/admin/components/accounts/UserForm.jsx | 129 | |
| 152 | ) | client/pages/admin/components/accounts/UserForm.jsx | 130 | |
| 153 | ); | client/pages/admin/components/accounts/UserForm.jsx | 131 | |
| 154 | } | client/pages/admin/components/accounts/UserForm.jsx | 132 | |
| 155 | client/pages/admin/components/accounts/UserForm.jsx | 133 | ||
| 156 | 20 | return React.createElement( | client/pages/admin/components/accounts/UserForm.jsx | 135 |
| 157 | 'form', | client/pages/admin/components/accounts/UserForm.jsx | 136 | |
| 158 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/accounts/UserForm.jsx | 136 | |
| 159 | notice, | client/pages/admin/components/accounts/UserForm.jsx | 136 | |
| 160 | formElements | client/pages/admin/components/accounts/UserForm.jsx | 137 | |
| 161 | ); | client/pages/admin/components/accounts/UserForm.jsx | 138 | |
| 162 | } | client/pages/admin/components/accounts/UserForm.jsx | 140 | |
| 163 | }); | client/pages/admin/components/accounts/UserForm.jsx | 141 | |
| 164 | client/pages/admin/components/accounts/UserForm.jsx | 142 | ||
| 165 | 1 | module.exports = Component; | client/pages/admin/components/accounts/UserForm.jsx | 145 |
| 166 | client/pages/admin/components/accounts/UserForm.jsx | 145 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 1 | |
| 2 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 1 |
| 4 | 1 | var Modal = require('../../../../components/Modal'); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 4 |
| 7 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 6 |
| 9 | 1 | var Actions = require('../../actions/AdminGroup'); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 7 |
| 10 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 7 | ||
| 11 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 10 |
| 12 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 10 | ||
| 13 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 13 |
| 14 | displayName: 'Component', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 13 | |
| 15 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 13 | ||
| 16 | mixins: [LinkedState], | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 14 | |
| 17 | contextTypes: { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 15 | |
| 18 | router: React.PropTypes.func | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 16 | |
| 19 | }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 16 | |
| 20 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 18 | |
| 21 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 18 | ||
| 22 | 1 | return { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 20 |
| 23 | data: { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 21 | |
| 24 | hasError: {}, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 22 | |
| 25 | help: {} | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 23 | |
| 26 | } | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 23 | |
| 27 | }; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 24 | |
| 28 | }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 25 | |
| 29 | getInitialState: function getInitialState() { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 27 | |
| 30 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 27 | ||
| 31 | 15 | return {}; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 29 |
| 32 | }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 29 | |
| 33 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 31 | |
| 34 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 31 | ||
| 35 | 2 | clearTimeout(this.timeout); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 33 |
| 36 | }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 33 | |
| 37 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 35 | |
| 38 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 35 | ||
| 39 | 9 | if (!nextProps.data.show) { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 37 |
| 40 | 8 | this.replaceState({}); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 38 |
| 41 | } else { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 38 | |
| 42 | 1 | this.timeout = setTimeout((function () { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 41 |
| 43 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 41 | ||
| 44 | 1 | this.refs.name.refs.inputField.getDOMNode().focus(); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 43 |
| 45 | }).bind(this), 100); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 43 | |
| 46 | } | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 44 | |
| 47 | }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 45 | |
| 48 | onSubmit: function onSubmit(event) { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 47 | |
| 49 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 47 | ||
| 50 | 1 | event.preventDefault(); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 49 |
| 51 | 1 | event.stopPropagation(); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 50 |
| 52 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 50 | ||
| 53 | 1 | Actions.createNew({ | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 52 |
| 54 | name: this.state.name | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 53 | |
| 55 | }, this.context.router); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 53 | |
| 56 | }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 54 | |
| 57 | render: function render() { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 56 | |
| 58 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 56 | ||
| 59 | 24 | var alerts; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 58 |
| 60 | 24 | if (this.props.data.error) { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 59 |
| 61 | 1 | alerts = React.createElement( | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 60 |
| 62 | 'div', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 60 | |
| 63 | { className: 'alert alert-danger' }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 60 | |
| 64 | this.props.data.error | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 60 | |
| 65 | ); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 61 | |
| 66 | } | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 62 | |
| 67 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 63 | ||
| 68 | 24 | var notice; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 65 |
| 69 | 24 | if (this.props.data.success) { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 66 |
| 70 | 1 | notice = React.createElement( | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 67 |
| 71 | 'div', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 67 | |
| 72 | { className: 'alert alert-success' }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 67 | |
| 73 | 'Loading data...' | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 67 | |
| 74 | ); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 67 | |
| 75 | } | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 69 | |
| 76 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 70 | ||
| 77 | 24 | var formElements; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 72 |
| 78 | 24 | if (!this.props.data.success) { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 73 |
| 79 | 23 | formElements = React.createElement( | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 74 |
| 80 | 'fieldset', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 74 | |
| 81 | null, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 74 | |
| 82 | alerts, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 74 | |
| 83 | React.createElement(TextControl, { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 75 | |
| 84 | name: 'name', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 77 | |
| 85 | ref: 'name', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 78 | |
| 86 | label: 'Name', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 79 | |
| 87 | hasError: this.props.data.hasError.name, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 80 | |
| 88 | valueLink: this.linkState('name'), | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 81 | |
| 89 | help: this.props.data.help.name, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 82 | |
| 90 | disabled: this.props.data.loading | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 83 | |
| 91 | }), | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 83 | |
| 92 | React.createElement( | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 84 | |
| 93 | ControlGroup, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 85 | |
| 94 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 85 | |
| 95 | React.createElement( | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 85 | |
| 96 | Button, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 86 | |
| 97 | { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 86 | |
| 98 | type: 'submit', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 87 | |
| 99 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 88 | |
| 100 | disabled: this.props.data.loading }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 89 | |
| 101 | 'Create new', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 89 | |
| 102 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 89 | |
| 103 | ) | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 92 | |
| 104 | ) | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 93 | |
| 105 | ); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 94 | |
| 106 | } | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 95 | |
| 107 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 96 | ||
| 108 | 24 | return React.createElement( | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 98 |
| 109 | Modal, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 99 | |
| 110 | { | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 99 | |
| 111 | header: 'Create new', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 100 | |
| 112 | show: this.props.data.show, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 101 | |
| 113 | onClose: Actions.hideCreateNew }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 102 | |
| 114 | React.createElement( | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 102 | |
| 115 | 'form', | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 104 | |
| 116 | { onSubmit: this.onSubmit }, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 104 | |
| 117 | notice, | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 104 | |
| 118 | formElements | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 105 | |
| 119 | ) | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 106 | |
| 120 | ); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 107 | |
| 121 | } | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 109 | |
| 122 | }); | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 110 | |
| 123 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 111 | ||
| 124 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 114 |
| 125 | client/pages/admin/components/admin-groups/CreateNewForm.jsx | 114 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/admin-groups/DeleteForm.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/admin-groups/DeleteForm.jsx | 2 | |
| 3 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/AdminGroup'); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 6 |
| 9 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 6 | ||
| 10 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admin-groups/DeleteForm.jsx | 9 |
| 11 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 9 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/DeleteForm.jsx | 12 |
| 13 | displayName: 'Component', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 12 | |
| 14 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 12 | ||
| 15 | mixins: [LinkedState], | client/pages/admin/components/admin-groups/DeleteForm.jsx | 13 | |
| 16 | contextTypes: { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 14 | |
| 17 | router: React.PropTypes.func | client/pages/admin/components/admin-groups/DeleteForm.jsx | 15 | |
| 18 | }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 15 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 17 | |
| 20 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 17 | ||
| 21 | 10 | return {}; | client/pages/admin/components/admin-groups/DeleteForm.jsx | 19 |
| 22 | }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 19 | |
| 23 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 21 | |
| 24 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 21 | ||
| 25 | 1 | event.preventDefault(); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 23 |
| 26 | 1 | event.stopPropagation(); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 24 |
| 27 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 24 | ||
| 28 | 1 | Actions['delete']({ | client/pages/admin/components/admin-groups/DeleteForm.jsx | 26 |
| 29 | id: this.props.details._id | client/pages/admin/components/admin-groups/DeleteForm.jsx | 27 | |
| 30 | }, this.context.router); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 27 | |
| 31 | }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 28 | |
| 32 | onConfirm: function onConfirm(event) { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 30 | |
| 33 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 30 | ||
| 34 | 2 | if (!window.confirm('Are you sure?')) { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 32 |
| 35 | 1 | event.preventDefault(); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 33 |
| 36 | 1 | event.stopPropagation(); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 34 |
| 37 | } | client/pages/admin/components/admin-groups/DeleteForm.jsx | 34 | |
| 38 | }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 35 | |
| 39 | render: function render() { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 37 | |
| 40 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 37 | ||
| 41 | 16 | var alerts; | client/pages/admin/components/admin-groups/DeleteForm.jsx | 39 |
| 42 | 16 | if (this.props.data.error) { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 40 |
| 43 | 1 | alerts = React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 41 |
| 44 | 'div', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 41 | |
| 45 | { className: 'alert alert-danger' }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 41 | |
| 46 | this.props.data.error | client/pages/admin/components/admin-groups/DeleteForm.jsx | 41 | |
| 47 | ); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 42 | |
| 48 | } | client/pages/admin/components/admin-groups/DeleteForm.jsx | 43 | |
| 49 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 44 | ||
| 50 | 16 | return React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 46 |
| 51 | 'form', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 47 | |
| 52 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 47 | |
| 53 | React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 47 | |
| 54 | 'fieldset', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 48 | |
| 55 | null, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 48 | |
| 56 | React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 48 | |
| 57 | 'legend', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 49 | |
| 58 | null, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 49 | |
| 59 | 'Danger zone' | client/pages/admin/components/admin-groups/DeleteForm.jsx | 49 | |
| 60 | ), | client/pages/admin/components/admin-groups/DeleteForm.jsx | 49 | |
| 61 | React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 49 | |
| 62 | 'p', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 50 | |
| 63 | null, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 50 | |
| 64 | React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 50 | |
| 65 | 'span', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 51 | |
| 66 | { className: 'label label-danger' }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 51 | |
| 67 | 'Warning' | client/pages/admin/components/admin-groups/DeleteForm.jsx | 51 | |
| 68 | ), | client/pages/admin/components/admin-groups/DeleteForm.jsx | 51 | |
| 69 | 'Â This cannot be undone and could result in orphaned document relationships.' | client/pages/admin/components/admin-groups/DeleteForm.jsx | 51 | |
| 70 | ), | client/pages/admin/components/admin-groups/DeleteForm.jsx | 51 | |
| 71 | alerts, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 54 | |
| 72 | React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 55 | |
| 73 | ControlGroup, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 56 | |
| 74 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 56 | |
| 75 | React.createElement( | client/pages/admin/components/admin-groups/DeleteForm.jsx | 56 | |
| 76 | Button, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 57 | |
| 77 | { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 57 | |
| 78 | type: 'submit', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 58 | |
| 79 | inputClasses: { 'btn-danger': true }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 59 | |
| 80 | disabled: this.props.data.loading, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 60 | |
| 81 | onClick: this.onConfirm }, | client/pages/admin/components/admin-groups/DeleteForm.jsx | 61 | |
| 82 | 'Delete', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 61 | |
| 83 | React.createElement(Spinner, { | client/pages/admin/components/admin-groups/DeleteForm.jsx | 61 | |
| 84 | space: 'left', | client/pages/admin/components/admin-groups/DeleteForm.jsx | 65 | |
| 85 | show: this.props.data.loading | client/pages/admin/components/admin-groups/DeleteForm.jsx | 66 | |
| 86 | }) | client/pages/admin/components/admin-groups/DeleteForm.jsx | 66 | |
| 87 | ) | client/pages/admin/components/admin-groups/DeleteForm.jsx | 67 | |
| 88 | ) | client/pages/admin/components/admin-groups/DeleteForm.jsx | 68 | |
| 89 | ) | client/pages/admin/components/admin-groups/DeleteForm.jsx | 69 | |
| 90 | ); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 70 | |
| 91 | } | client/pages/admin/components/admin-groups/DeleteForm.jsx | 72 | |
| 92 | }); | client/pages/admin/components/admin-groups/DeleteForm.jsx | 73 | |
| 93 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 74 | ||
| 94 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/DeleteForm.jsx | 77 |
| 95 | client/pages/admin/components/admin-groups/DeleteForm.jsx | 77 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admin-groups/Details.jsx | 1 | |
| 2 | client/pages/admin/components/admin-groups/Details.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/Details.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/admin-groups/Details.jsx | 2 |
| 5 | 1 | var DetailsForm = require('./DetailsForm'); | client/pages/admin/components/admin-groups/Details.jsx | 3 |
| 6 | 1 | var PermissionsForm = require('./PermissionsForm'); | client/pages/admin/components/admin-groups/Details.jsx | 4 |
| 7 | 1 | var DeleteForm = require('./DeleteForm'); | client/pages/admin/components/admin-groups/Details.jsx | 5 |
| 8 | 1 | var AdminGroupStore = require('../../stores/AdminGroup'); | client/pages/admin/components/admin-groups/Details.jsx | 6 |
| 9 | 1 | var Actions = require('../../actions/AdminGroup'); | client/pages/admin/components/admin-groups/Details.jsx | 7 |
| 10 | client/pages/admin/components/admin-groups/Details.jsx | 7 | ||
| 11 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admin-groups/Details.jsx | 10 |
| 12 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/admin-groups/Details.jsx | 11 |
| 13 | client/pages/admin/components/admin-groups/Details.jsx | 11 | ||
| 14 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/Details.jsx | 14 |
| 15 | displayName: 'Component', | client/pages/admin/components/admin-groups/Details.jsx | 14 | |
| 16 | client/pages/admin/components/admin-groups/Details.jsx | 14 | ||
| 17 | mixins: [LinkedState], | client/pages/admin/components/admin-groups/Details.jsx | 15 | |
| 18 | contextTypes: { | client/pages/admin/components/admin-groups/Details.jsx | 16 | |
| 19 | router: React.PropTypes.func | client/pages/admin/components/admin-groups/Details.jsx | 17 | |
| 20 | }, | client/pages/admin/components/admin-groups/Details.jsx | 17 | |
| 21 | getInitialState: function getInitialState() { | client/pages/admin/components/admin-groups/Details.jsx | 19 | |
| 22 | client/pages/admin/components/admin-groups/Details.jsx | 19 | ||
| 23 | 4 | AdminGroupStore.resetDetails(); | client/pages/admin/components/admin-groups/Details.jsx | 21 |
| 24 | 4 | AdminGroupStore.resetPermissions(); | client/pages/admin/components/admin-groups/Details.jsx | 22 |
| 25 | 4 | AdminGroupStore.resetDelete(); | client/pages/admin/components/admin-groups/Details.jsx | 23 |
| 26 | client/pages/admin/components/admin-groups/Details.jsx | 23 | ||
| 27 | 4 | Actions.getDetails(this.context.router.getCurrentParams()); | client/pages/admin/components/admin-groups/Details.jsx | 25 |
| 28 | client/pages/admin/components/admin-groups/Details.jsx | 25 | ||
| 29 | 4 | return { | client/pages/admin/components/admin-groups/Details.jsx | 27 |
| 30 | details: AdminGroupStore.getDetails(), | client/pages/admin/components/admin-groups/Details.jsx | 28 | |
| 31 | permissions: AdminGroupStore.getPermissions(), | client/pages/admin/components/admin-groups/Details.jsx | 29 | |
| 32 | 'delete': AdminGroupStore.getDelete() | client/pages/admin/components/admin-groups/Details.jsx | 30 | |
| 33 | }; | client/pages/admin/components/admin-groups/Details.jsx | 30 | |
| 34 | }, | client/pages/admin/components/admin-groups/Details.jsx | 31 | |
| 35 | componentDidMount: function componentDidMount() { | client/pages/admin/components/admin-groups/Details.jsx | 33 | |
| 36 | client/pages/admin/components/admin-groups/Details.jsx | 33 | ||
| 37 | 4 | AdminGroupStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/admin-groups/Details.jsx | 35 |
| 38 | }, | client/pages/admin/components/admin-groups/Details.jsx | 35 | |
| 39 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/admin-groups/Details.jsx | 37 | |
| 40 | client/pages/admin/components/admin-groups/Details.jsx | 37 | ||
| 41 | 1 | AdminGroupStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/admin-groups/Details.jsx | 39 |
| 42 | }, | client/pages/admin/components/admin-groups/Details.jsx | 39 | |
| 43 | onStoreChange: function onStoreChange() { | client/pages/admin/components/admin-groups/Details.jsx | 41 | |
| 44 | client/pages/admin/components/admin-groups/Details.jsx | 41 | ||
| 45 | 2 | this.setState({ | client/pages/admin/components/admin-groups/Details.jsx | 43 |
| 46 | details: AdminGroupStore.getDetails(), | client/pages/admin/components/admin-groups/Details.jsx | 44 | |
| 47 | permissions: AdminGroupStore.getPermissions(), | client/pages/admin/components/admin-groups/Details.jsx | 45 | |
| 48 | 'delete': AdminGroupStore.getDelete() | client/pages/admin/components/admin-groups/Details.jsx | 46 | |
| 49 | }); | client/pages/admin/components/admin-groups/Details.jsx | 46 | |
| 50 | }, | client/pages/admin/components/admin-groups/Details.jsx | 47 | |
| 51 | render: function render() { | client/pages/admin/components/admin-groups/Details.jsx | 49 | |
| 52 | client/pages/admin/components/admin-groups/Details.jsx | 49 | ||
| 53 | 7 | if (this.state.details.hydrated && this.state.details.fetchFailure) { | client/pages/admin/components/admin-groups/Details.jsx | 51 |
| 54 | 1 | return React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 52 |
| 55 | 'section', | client/pages/admin/components/admin-groups/Details.jsx | 53 | |
| 56 | { className: 'section-admin-group-details container' }, | client/pages/admin/components/admin-groups/Details.jsx | 53 | |
| 57 | React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 53 | |
| 58 | 'h1', | client/pages/admin/components/admin-groups/Details.jsx | 54 | |
| 59 | { className: 'page-header' }, | client/pages/admin/components/admin-groups/Details.jsx | 54 | |
| 60 | React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 54 | |
| 61 | Link, | client/pages/admin/components/admin-groups/Details.jsx | 55 | |
| 62 | { to: 'adminGroups' }, | client/pages/admin/components/admin-groups/Details.jsx | 55 | |
| 63 | 'Admin Groups' | client/pages/admin/components/admin-groups/Details.jsx | 55 | |
| 64 | ), | client/pages/admin/components/admin-groups/Details.jsx | 55 | |
| 65 | ' / Error' | client/pages/admin/components/admin-groups/Details.jsx | 55 | |
| 66 | ), | client/pages/admin/components/admin-groups/Details.jsx | 55 | |
| 67 | React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 56 | |
| 68 | 'div', | client/pages/admin/components/admin-groups/Details.jsx | 57 | |
| 69 | { className: 'alert alert-danger' }, | client/pages/admin/components/admin-groups/Details.jsx | 57 | |
| 70 | this.state.details.error | client/pages/admin/components/admin-groups/Details.jsx | 57 | |
| 71 | ) | client/pages/admin/components/admin-groups/Details.jsx | 58 | |
| 72 | ); | client/pages/admin/components/admin-groups/Details.jsx | 59 | |
| 73 | } | client/pages/admin/components/admin-groups/Details.jsx | 61 | |
| 74 | client/pages/admin/components/admin-groups/Details.jsx | 62 | ||
| 75 | 6 | return React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 64 |
| 76 | 'section', | client/pages/admin/components/admin-groups/Details.jsx | 65 | |
| 77 | { className: 'section-admin-group-details container' }, | client/pages/admin/components/admin-groups/Details.jsx | 65 | |
| 78 | React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 65 | |
| 79 | 'h1', | client/pages/admin/components/admin-groups/Details.jsx | 66 | |
| 80 | { className: 'page-header' }, | client/pages/admin/components/admin-groups/Details.jsx | 66 | |
| 81 | React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 66 | |
| 82 | Link, | client/pages/admin/components/admin-groups/Details.jsx | 67 | |
| 83 | { to: 'adminGroups' }, | client/pages/admin/components/admin-groups/Details.jsx | 67 | |
| 84 | 'Admin Groups' | client/pages/admin/components/admin-groups/Details.jsx | 67 | |
| 85 | ), | client/pages/admin/components/admin-groups/Details.jsx | 67 | |
| 86 | ' / ', | client/pages/admin/components/admin-groups/Details.jsx | 67 | |
| 87 | this.state.details.name | client/pages/admin/components/admin-groups/Details.jsx | 67 | |
| 88 | ), | client/pages/admin/components/admin-groups/Details.jsx | 67 | |
| 89 | React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 68 | |
| 90 | 'div', | client/pages/admin/components/admin-groups/Details.jsx | 69 | |
| 91 | { className: 'row' }, | client/pages/admin/components/admin-groups/Details.jsx | 69 | |
| 92 | React.createElement( | client/pages/admin/components/admin-groups/Details.jsx | 69 | |
| 93 | 'div', | client/pages/admin/components/admin-groups/Details.jsx | 70 | |
| 94 | { className: 'col-sm-6' }, | client/pages/admin/components/admin-groups/Details.jsx | 70 | |
| 95 | React.createElement(DetailsForm, { data: this.state.details }), | client/pages/admin/components/admin-groups/Details.jsx | 70 | |
| 96 | React.createElement(PermissionsForm, { | client/pages/admin/components/admin-groups/Details.jsx | 71 | |
| 97 | details: this.state.details, | client/pages/admin/components/admin-groups/Details.jsx | 73 | |
| 98 | data: this.state.permissions | client/pages/admin/components/admin-groups/Details.jsx | 74 | |
| 99 | }), | client/pages/admin/components/admin-groups/Details.jsx | 74 | |
| 100 | React.createElement(DeleteForm, { | client/pages/admin/components/admin-groups/Details.jsx | 75 | |
| 101 | details: this.state.details, | client/pages/admin/components/admin-groups/Details.jsx | 77 | |
| 102 | data: this.state['delete'] | client/pages/admin/components/admin-groups/Details.jsx | 78 | |
| 103 | }) | client/pages/admin/components/admin-groups/Details.jsx | 78 | |
| 104 | ) | client/pages/admin/components/admin-groups/Details.jsx | 79 | |
| 105 | ) | client/pages/admin/components/admin-groups/Details.jsx | 80 | |
| 106 | ); | client/pages/admin/components/admin-groups/Details.jsx | 81 | |
| 107 | } | client/pages/admin/components/admin-groups/Details.jsx | 83 | |
| 108 | }); | client/pages/admin/components/admin-groups/Details.jsx | 84 | |
| 109 | client/pages/admin/components/admin-groups/Details.jsx | 85 | ||
| 110 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/Details.jsx | 88 |
| 111 | client/pages/admin/components/admin-groups/Details.jsx | 88 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admin-groups/DetailsForm.jsx | 1 | |
| 2 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/AdminGroup'); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 6 |
| 9 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/DetailsForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 9 | |
| 12 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/admin-groups/DetailsForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 11 | |
| 15 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 11 | ||
| 16 | 10 | return {}; | client/pages/admin/components/admin-groups/DetailsForm.jsx | 13 |
| 17 | }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 13 | |
| 18 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 15 | |
| 19 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 15 | ||
| 20 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 17 |
| 21 | 5 | this.setState({ | client/pages/admin/components/admin-groups/DetailsForm.jsx | 18 |
| 22 | hydrated: nextProps.data.hydrated, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 19 | |
| 23 | name: nextProps.data.name | client/pages/admin/components/admin-groups/DetailsForm.jsx | 20 | |
| 24 | }); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 20 | |
| 25 | } | client/pages/admin/components/admin-groups/DetailsForm.jsx | 21 | |
| 26 | }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 22 | |
| 27 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 24 | |
| 28 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 24 | ||
| 29 | 1 | event.preventDefault(); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 26 |
| 30 | 1 | event.stopPropagation(); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 27 |
| 31 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 27 | ||
| 32 | 1 | Actions.saveDetails({ | client/pages/admin/components/admin-groups/DetailsForm.jsx | 29 |
| 33 | id: this.props.data._id, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 30 | |
| 34 | name: this.state.name | client/pages/admin/components/admin-groups/DetailsForm.jsx | 31 | |
| 35 | }); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 31 | |
| 36 | }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 32 | |
| 37 | render: function render() { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 34 | |
| 38 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 34 | ||
| 39 | 16 | var alerts = []; | client/pages/admin/components/admin-groups/DetailsForm.jsx | 36 |
| 40 | 16 | if (this.props.data.success) { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 37 |
| 41 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 38 |
| 42 | 'div', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 38 | |
| 43 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 38 | |
| 44 | 'Success. Changes have been saved.' | client/pages/admin/components/admin-groups/DetailsForm.jsx | 38 | |
| 45 | )); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 38 | |
| 46 | 15 | } else if (this.props.data.error) { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 40 |
| 47 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 43 |
| 48 | 'div', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 43 | |
| 49 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 43 | |
| 50 | this.props.data.error | client/pages/admin/components/admin-groups/DetailsForm.jsx | 43 | |
| 51 | )); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 44 | |
| 52 | } | client/pages/admin/components/admin-groups/DetailsForm.jsx | 45 | |
| 53 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 46 | ||
| 54 | 16 | var notice; | client/pages/admin/components/admin-groups/DetailsForm.jsx | 48 |
| 55 | 16 | if (!this.props.data.hydrated) { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 49 |
| 56 | 12 | notice = React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 50 |
| 57 | 'div', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 50 | |
| 58 | { className: 'alert alert-info' }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 50 | |
| 59 | 'Loading data...' | client/pages/admin/components/admin-groups/DetailsForm.jsx | 50 | |
| 60 | ); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 50 | |
| 61 | } | client/pages/admin/components/admin-groups/DetailsForm.jsx | 52 | |
| 62 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 53 | ||
| 63 | 16 | var formElements; | client/pages/admin/components/admin-groups/DetailsForm.jsx | 55 |
| 64 | 16 | if (this.props.data.hydrated) { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 56 |
| 65 | 4 | formElements = React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 57 |
| 66 | 'fieldset', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 57 | |
| 67 | null, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 57 | |
| 68 | React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 57 | |
| 69 | 'legend', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 58 | |
| 70 | null, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 58 | |
| 71 | 'Details' | client/pages/admin/components/admin-groups/DetailsForm.jsx | 58 | |
| 72 | ), | client/pages/admin/components/admin-groups/DetailsForm.jsx | 58 | |
| 73 | alerts, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 58 | |
| 74 | React.createElement(TextControl, { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 59 | |
| 75 | name: 'name', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 61 | |
| 76 | label: 'Name', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 62 | |
| 77 | hasError: this.props.data.hasError.name, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 63 | |
| 78 | valueLink: this.linkState('name'), | client/pages/admin/components/admin-groups/DetailsForm.jsx | 64 | |
| 79 | help: this.props.data.help.name, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 65 | |
| 80 | disabled: this.props.data.loading | client/pages/admin/components/admin-groups/DetailsForm.jsx | 66 | |
| 81 | }), | client/pages/admin/components/admin-groups/DetailsForm.jsx | 66 | |
| 82 | React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 67 | |
| 83 | ControlGroup, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 68 | |
| 84 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 68 | |
| 85 | React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 68 | |
| 86 | Button, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 69 | |
| 87 | { | client/pages/admin/components/admin-groups/DetailsForm.jsx | 69 | |
| 88 | type: 'submit', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 70 | |
| 89 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 71 | |
| 90 | disabled: this.props.data.loading }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 72 | |
| 91 | 'Save changes', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 72 | |
| 92 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admin-groups/DetailsForm.jsx | 72 | |
| 93 | ) | client/pages/admin/components/admin-groups/DetailsForm.jsx | 75 | |
| 94 | ) | client/pages/admin/components/admin-groups/DetailsForm.jsx | 76 | |
| 95 | ); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 77 | |
| 96 | } | client/pages/admin/components/admin-groups/DetailsForm.jsx | 78 | |
| 97 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 79 | ||
| 98 | 16 | return React.createElement( | client/pages/admin/components/admin-groups/DetailsForm.jsx | 81 |
| 99 | 'form', | client/pages/admin/components/admin-groups/DetailsForm.jsx | 82 | |
| 100 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 82 | |
| 101 | notice, | client/pages/admin/components/admin-groups/DetailsForm.jsx | 82 | |
| 102 | formElements | client/pages/admin/components/admin-groups/DetailsForm.jsx | 83 | |
| 103 | ); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 84 | |
| 104 | } | client/pages/admin/components/admin-groups/DetailsForm.jsx | 86 | |
| 105 | }); | client/pages/admin/components/admin-groups/DetailsForm.jsx | 87 | |
| 106 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 88 | ||
| 107 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/DetailsForm.jsx | 91 |
| 108 | client/pages/admin/components/admin-groups/DetailsForm.jsx | 91 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admin-groups/FilterForm.jsx | 1 | |
| 2 | client/pages/admin/components/admin-groups/FilterForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/FilterForm.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/pages/admin/components/admin-groups/FilterForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/admin-groups/FilterForm.jsx | 3 |
| 6 | 1 | var SelectControl = require('../../../../components/form/SelectControl'); | client/pages/admin/components/admin-groups/FilterForm.jsx | 4 |
| 7 | client/pages/admin/components/admin-groups/FilterForm.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/FilterForm.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/admin-groups/FilterForm.jsx | 7 | |
| 10 | client/pages/admin/components/admin-groups/FilterForm.jsx | 7 | ||
| 11 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/admin-groups/FilterForm.jsx | 8 | |
| 12 | defaultState: { | client/pages/admin/components/admin-groups/FilterForm.jsx | 9 | |
| 13 | name: '', | client/pages/admin/components/admin-groups/FilterForm.jsx | 10 | |
| 14 | sort: '_id', | client/pages/admin/components/admin-groups/FilterForm.jsx | 11 | |
| 15 | limit: 20, | client/pages/admin/components/admin-groups/FilterForm.jsx | 12 | |
| 16 | page: 1 | client/pages/admin/components/admin-groups/FilterForm.jsx | 13 | |
| 17 | }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/admin-groups/FilterForm.jsx | 15 | |
| 19 | client/pages/admin/components/admin-groups/FilterForm.jsx | 15 | ||
| 20 | 14 | return ObjectAssign({}, this.defaultState, this.props.query); | client/pages/admin/components/admin-groups/FilterForm.jsx | 17 |
| 21 | }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 17 | |
| 22 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admin-groups/FilterForm.jsx | 19 | |
| 23 | client/pages/admin/components/admin-groups/FilterForm.jsx | 19 | ||
| 24 | 6 | var nextState = ObjectAssign({}, this.defaultState, nextProps.query); | client/pages/admin/components/admin-groups/FilterForm.jsx | 21 |
| 25 | 6 | this.setState(nextState); | client/pages/admin/components/admin-groups/FilterForm.jsx | 22 |
| 26 | }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 22 | |
| 27 | onMenuChange: function onMenuChange(event) { | client/pages/admin/components/admin-groups/FilterForm.jsx | 24 | |
| 28 | client/pages/admin/components/admin-groups/FilterForm.jsx | 24 | ||
| 29 | 2 | var newState = { page: 1 }; | client/pages/admin/components/admin-groups/FilterForm.jsx | 26 |
| 30 | 2 | newState[event.target.name] = event.target.value; | client/pages/admin/components/admin-groups/FilterForm.jsx | 27 |
| 31 | 2 | this.setState(newState, this.props.onChange); | client/pages/admin/components/admin-groups/FilterForm.jsx | 28 |
| 32 | }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 28 | |
| 33 | onEnterSubmit: function onEnterSubmit(event) { | client/pages/admin/components/admin-groups/FilterForm.jsx | 30 | |
| 34 | client/pages/admin/components/admin-groups/FilterForm.jsx | 30 | ||
| 35 | 2 | if (event.which === 13) { | client/pages/admin/components/admin-groups/FilterForm.jsx | 32 |
| 36 | 1 | event.preventDefault(); | client/pages/admin/components/admin-groups/FilterForm.jsx | 33 |
| 37 | 1 | event.stopPropagation(); | client/pages/admin/components/admin-groups/FilterForm.jsx | 34 |
| 38 | 1 | this.setState({ page: 1 }, this.props.onChange); | client/pages/admin/components/admin-groups/FilterForm.jsx | 35 |
| 39 | } | client/pages/admin/components/admin-groups/FilterForm.jsx | 35 | |
| 40 | }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 36 | |
| 41 | changePage: function changePage(page) { | client/pages/admin/components/admin-groups/FilterForm.jsx | 38 | |
| 42 | client/pages/admin/components/admin-groups/FilterForm.jsx | 38 | ||
| 43 | 2 | this.setState({ page: page }, this.props.onChange); | client/pages/admin/components/admin-groups/FilterForm.jsx | 40 |
| 44 | }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 40 | |
| 45 | render: function render() { | client/pages/admin/components/admin-groups/FilterForm.jsx | 42 | |
| 46 | client/pages/admin/components/admin-groups/FilterForm.jsx | 42 | ||
| 47 | 25 | return React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 44 |
| 48 | 'form', | client/pages/admin/components/admin-groups/FilterForm.jsx | 45 | |
| 49 | { onKeyDown: this.onEnterSubmit, onSubmit: this.props.onChange }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 45 | |
| 50 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 45 | |
| 51 | 'div', | client/pages/admin/components/admin-groups/FilterForm.jsx | 46 | |
| 52 | { className: 'row' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 46 | |
| 53 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 46 | |
| 54 | 'div', | client/pages/admin/components/admin-groups/FilterForm.jsx | 47 | |
| 55 | { className: 'col-sm-4' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 47 | |
| 56 | React.createElement(TextControl, { | client/pages/admin/components/admin-groups/FilterForm.jsx | 47 | |
| 57 | name: 'name', | client/pages/admin/components/admin-groups/FilterForm.jsx | 49 | |
| 58 | label: 'Name search', | client/pages/admin/components/admin-groups/FilterForm.jsx | 50 | |
| 59 | valueLink: this.linkState('name'), | client/pages/admin/components/admin-groups/FilterForm.jsx | 51 | |
| 60 | disabled: this.props.loading | client/pages/admin/components/admin-groups/FilterForm.jsx | 52 | |
| 61 | }) | client/pages/admin/components/admin-groups/FilterForm.jsx | 52 | |
| 62 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 53 | |
| 63 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 54 | |
| 64 | 'div', | client/pages/admin/components/admin-groups/FilterForm.jsx | 55 | |
| 65 | { className: 'col-sm-4' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 55 | |
| 66 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 55 | |
| 67 | SelectControl, | client/pages/admin/components/admin-groups/FilterForm.jsx | 56 | |
| 68 | { | client/pages/admin/components/admin-groups/FilterForm.jsx | 56 | |
| 69 | name: 'sort', | client/pages/admin/components/admin-groups/FilterForm.jsx | 57 | |
| 70 | label: 'Sort by', | client/pages/admin/components/admin-groups/FilterForm.jsx | 58 | |
| 71 | disabled: this.props.loading, | client/pages/admin/components/admin-groups/FilterForm.jsx | 59 | |
| 72 | onChange: this.onMenuChange, | client/pages/admin/components/admin-groups/FilterForm.jsx | 60 | |
| 73 | value: this.state.sort }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 61 | |
| 74 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 61 | |
| 75 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 63 | |
| 76 | { value: '_id' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 63 | |
| 77 | 'id â–²' | client/pages/admin/components/admin-groups/FilterForm.jsx | 63 | |
| 78 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 63 | |
| 79 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 63 | |
| 80 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 64 | |
| 81 | { value: '-_id' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 64 | |
| 82 | 'id â–¼' | client/pages/admin/components/admin-groups/FilterForm.jsx | 64 | |
| 83 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 64 | |
| 84 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 64 | |
| 85 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 65 | |
| 86 | { value: 'name' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 65 | |
| 87 | 'name â–²' | client/pages/admin/components/admin-groups/FilterForm.jsx | 65 | |
| 88 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 65 | |
| 89 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 65 | |
| 90 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 66 | |
| 91 | { value: '-name' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 66 | |
| 92 | 'name â–¼' | client/pages/admin/components/admin-groups/FilterForm.jsx | 66 | |
| 93 | ) | client/pages/admin/components/admin-groups/FilterForm.jsx | 66 | |
| 94 | ) | client/pages/admin/components/admin-groups/FilterForm.jsx | 66 | |
| 95 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 67 | |
| 96 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 68 | |
| 97 | 'div', | client/pages/admin/components/admin-groups/FilterForm.jsx | 69 | |
| 98 | { className: 'col-sm-4' }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 69 | |
| 99 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 69 | |
| 100 | SelectControl, | client/pages/admin/components/admin-groups/FilterForm.jsx | 70 | |
| 101 | { | client/pages/admin/components/admin-groups/FilterForm.jsx | 70 | |
| 102 | name: 'limit', | client/pages/admin/components/admin-groups/FilterForm.jsx | 71 | |
| 103 | label: 'Limit', | client/pages/admin/components/admin-groups/FilterForm.jsx | 72 | |
| 104 | disabled: this.props.loading, | client/pages/admin/components/admin-groups/FilterForm.jsx | 73 | |
| 105 | onChange: this.onMenuChange, | client/pages/admin/components/admin-groups/FilterForm.jsx | 74 | |
| 106 | value: this.state.limit }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 75 | |
| 107 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 75 | |
| 108 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 77 | |
| 109 | { value: 10 }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 77 | |
| 110 | '10 items' | client/pages/admin/components/admin-groups/FilterForm.jsx | 77 | |
| 111 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 77 | |
| 112 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 77 | |
| 113 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 78 | |
| 114 | { value: 20 }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 78 | |
| 115 | '20 items' | client/pages/admin/components/admin-groups/FilterForm.jsx | 78 | |
| 116 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 78 | |
| 117 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 78 | |
| 118 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 79 | |
| 119 | { value: 50 }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 79 | |
| 120 | '50 items' | client/pages/admin/components/admin-groups/FilterForm.jsx | 79 | |
| 121 | ), | client/pages/admin/components/admin-groups/FilterForm.jsx | 79 | |
| 122 | React.createElement( | client/pages/admin/components/admin-groups/FilterForm.jsx | 79 | |
| 123 | 'option', | client/pages/admin/components/admin-groups/FilterForm.jsx | 80 | |
| 124 | { value: 100 }, | client/pages/admin/components/admin-groups/FilterForm.jsx | 80 | |
| 125 | '100 items' | client/pages/admin/components/admin-groups/FilterForm.jsx | 80 | |
| 126 | ) | client/pages/admin/components/admin-groups/FilterForm.jsx | 80 | |
| 127 | ) | client/pages/admin/components/admin-groups/FilterForm.jsx | 80 | |
| 128 | ) | client/pages/admin/components/admin-groups/FilterForm.jsx | 81 | |
| 129 | ) | client/pages/admin/components/admin-groups/FilterForm.jsx | 82 | |
| 130 | ); | client/pages/admin/components/admin-groups/FilterForm.jsx | 83 | |
| 131 | } | client/pages/admin/components/admin-groups/FilterForm.jsx | 85 | |
| 132 | }); | client/pages/admin/components/admin-groups/FilterForm.jsx | 86 | |
| 133 | client/pages/admin/components/admin-groups/FilterForm.jsx | 87 | ||
| 134 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/FilterForm.jsx | 90 |
| 135 | client/pages/admin/components/admin-groups/FilterForm.jsx | 90 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 1 | |
| 2 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 2 |
| 5 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 3 |
| 6 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 4 |
| 7 | 1 | var Actions = require('../../actions/AdminGroup'); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 5 |
| 8 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 5 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 8 |
| 10 | displayName: 'Component', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 8 | |
| 11 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 8 | ||
| 12 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 9 | |
| 13 | getInitialState: function getInitialState() { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 10 | |
| 14 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 10 | ||
| 15 | 15 | return {}; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 12 |
| 16 | }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 12 | |
| 17 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 14 | |
| 18 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 14 | ||
| 19 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 16 |
| 20 | 5 | this.setState({ | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 17 |
| 21 | hydrated: nextProps.details.hydrated, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 18 | |
| 22 | permissions: nextProps.details.permissions | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 19 | |
| 23 | }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 19 | |
| 24 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 20 | |
| 25 | }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 21 | |
| 26 | handleNewPermission: function handleNewPermission(event) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 23 | |
| 27 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 23 | ||
| 28 | 10 | var newPermission = this.refs.newPermission.getDOMNode().value.trim(); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 25 |
| 29 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 25 | ||
| 30 | 10 | if (!newPermission) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 27 |
| 31 | 1 | return; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 28 |
| 32 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 28 | |
| 33 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 29 | ||
| 34 | 9 | var nextPermissions = this.state.permissions || {}; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 31 |
| 35 | 9 | if (nextPermissions.hasOwnProperty(newPermission)) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 32 |
| 36 | 2 | this.setState({ error: 'That permission already exists.' }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 33 |
| 37 | 2 | setTimeout((function () { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 34 |
| 38 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 34 | ||
| 39 | 1 | this.setState({ error: undefined }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 36 |
| 40 | }).bind(this), 2500); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 36 | |
| 41 | } else { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 37 | |
| 42 | 7 | nextPermissions[newPermission] = true; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 40 |
| 43 | 7 | this.setState({ permissions: nextPermissions }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 41 |
| 44 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 41 | |
| 45 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 42 | ||
| 46 | 9 | this.setState({ newPermission: '' }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 44 |
| 47 | }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 44 | |
| 48 | onEnterNewPermission: function onEnterNewPermission(event) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 46 | |
| 49 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 46 | ||
| 50 | 10 | if (event.which === 13) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 48 |
| 51 | 9 | event.preventDefault(); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 49 |
| 52 | 9 | event.stopPropagation(); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 50 |
| 53 | 9 | this.handleNewPermission(event); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 51 |
| 54 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 51 | |
| 55 | }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 52 | |
| 56 | handleTogglePermission: function handleTogglePermission(key, event) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 54 | |
| 57 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 54 | ||
| 58 | 1 | var nextPermissions = this.state.permissions; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 56 |
| 59 | 1 | nextPermissions[key] = !nextPermissions[key]; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 57 |
| 60 | 1 | this.setState({ permissions: nextPermissions }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 58 |
| 61 | }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 58 | |
| 62 | handleDeletePermission: function handleDeletePermission(key, event) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 60 | |
| 63 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 60 | ||
| 64 | 1 | var nextPermissions = this.state.permissions; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 62 |
| 65 | 1 | delete nextPermissions[key]; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 63 |
| 66 | 1 | this.setState({ permissions: nextPermissions }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 64 |
| 67 | }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 64 | |
| 68 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 66 | |
| 69 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 66 | ||
| 70 | 1 | event.preventDefault(); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 68 |
| 71 | 1 | event.stopPropagation(); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 69 |
| 72 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 69 | ||
| 73 | 1 | Actions.savePermissions({ | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 71 |
| 74 | id: this.props.details._id, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 72 | |
| 75 | permissions: this.state.permissions | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 73 | |
| 76 | }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 73 | |
| 77 | }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 74 | |
| 78 | render: function render() { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 76 | |
| 79 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 76 | ||
| 80 | 41 | var alerts = []; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 78 |
| 81 | 41 | var error = this.props.data.error || this.state.error; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 79 |
| 82 | 41 | if (this.props.data.success) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 80 |
| 83 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 81 |
| 84 | 'div', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 81 | |
| 85 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 81 | |
| 86 | 'Success. Changes have been saved.' | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 81 | |
| 87 | )); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 81 | |
| 88 | 40 | } else if (error) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 83 |
| 89 | 3 | alerts.push(React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 86 |
| 90 | 'div', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 86 | |
| 91 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 86 | |
| 92 | error | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 86 | |
| 93 | )); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 87 | |
| 94 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 88 | |
| 95 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 89 | ||
| 96 | 41 | var notice; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 91 |
| 97 | 41 | if (!this.props.details.hydrated) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 92 |
| 98 | 12 | notice = React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 93 |
| 99 | 'div', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 93 | |
| 100 | { className: 'alert alert-info' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 93 | |
| 101 | 'Loading data...' | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 93 | |
| 102 | ); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 93 | |
| 103 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 95 | |
| 104 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 96 | ||
| 105 | 41 | var formElements; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 98 |
| 106 | 41 | if (this.props.details.hydrated) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 99 |
| 107 | 29 | var permissions = this.state.permissions || {}; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 100 |
| 108 | 29 | var permissionKeys = Object.keys(permissions).sort(function (a, b) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 101 |
| 109 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 101 | ||
| 110 | 24 | return a.toLowerCase().localeCompare(b.toLowerCase()); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 103 |
| 111 | }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 103 | |
| 112 | 29 | var permissionsUi = permissionKeys.map((function (key) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 105 |
| 113 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 105 | ||
| 114 | 33 | var deleteHandler = this.handleDeletePermission.bind(this, key); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 107 |
| 115 | 33 | var toggleHandler = this.handleTogglePermission.bind(this, key); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 108 |
| 116 | 33 | var toggleIcon; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 109 |
| 117 | 33 | if (permissions[key]) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 110 |
| 118 | 32 | toggleIcon = React.createElement('i', { className: 'fa fa-toggle-on' }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 111 |
| 119 | } else { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 111 | |
| 120 | 1 | toggleIcon = React.createElement('i', { className: 'fa fa-toggle-off' }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 114 |
| 121 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 114 | |
| 122 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 115 | ||
| 123 | 33 | return React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 117 |
| 124 | 'div', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 118 | |
| 125 | { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 118 | |
| 126 | key: key, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 119 | |
| 127 | className: 'input-group' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 120 | |
| 128 | React.createElement('input', { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 120 | |
| 129 | type: 'text', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 123 | |
| 130 | className: 'form-control', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 124 | |
| 131 | disabled: true, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 125 | |
| 132 | value: key | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 126 | |
| 133 | }), | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 126 | |
| 134 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 127 | |
| 135 | 'span', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 128 | |
| 136 | { className: 'input-group-btn' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 128 | |
| 137 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 128 | |
| 138 | 'button', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 129 | |
| 139 | { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 129 | |
| 140 | type: 'button', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 130 | |
| 141 | className: 'btn btn-default', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 131 | |
| 142 | onClick: toggleHandler }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 132 | |
| 143 | toggleIcon | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 132 | |
| 144 | ), | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 134 | |
| 145 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 135 | |
| 146 | 'button', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 136 | |
| 147 | { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 136 | |
| 148 | type: 'button', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 137 | |
| 149 | className: 'btn btn-warning', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 138 | |
| 150 | onClick: deleteHandler }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 139 | |
| 151 | 'Remove' | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 139 | |
| 152 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 139 | |
| 153 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 142 | |
| 154 | ); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 143 | |
| 155 | }).bind(this)); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 145 | |
| 156 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 146 | ||
| 157 | 29 | if (permissionKeys.length === 0) { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 148 |
| 158 | 14 | permissionsUi = React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 149 |
| 159 | 'div', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 149 | |
| 160 | null, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 149 | |
| 161 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 149 | |
| 162 | 'span', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 150 | |
| 163 | { className: 'label label-default' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 150 | |
| 164 | 'empty list' | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 150 | |
| 165 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 150 | |
| 166 | ); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 152 | |
| 167 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 153 | |
| 168 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 154 | ||
| 169 | 29 | formElements = React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 156 |
| 170 | 'fieldset', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 156 | |
| 171 | null, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 156 | |
| 172 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 156 | |
| 173 | 'legend', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 157 | |
| 174 | null, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 157 | |
| 175 | 'Permissions' | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 157 | |
| 176 | ), | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 157 | |
| 177 | alerts, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 157 | |
| 178 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 158 | |
| 179 | ControlGroup, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 159 | |
| 180 | { label: 'Add permission', hideHelp: true }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 159 | |
| 181 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 159 | |
| 182 | 'div', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 160 | |
| 183 | { className: 'input-group' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 160 | |
| 184 | React.createElement('input', { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 160 | |
| 185 | ref: 'newPermission', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 162 | |
| 186 | type: 'text', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 163 | |
| 187 | name: 'newPermission', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 164 | |
| 188 | className: 'form-control', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 165 | |
| 189 | placeholder: '', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 166 | |
| 190 | onKeyDown: this.onEnterNewPermission, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 167 | |
| 191 | valueLink: this.linkState('newPermission') | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 168 | |
| 192 | }), | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 168 | |
| 193 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 169 | |
| 194 | 'span', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 170 | |
| 195 | { className: 'input-group-btn' }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 170 | |
| 196 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 170 | |
| 197 | 'button', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 171 | |
| 198 | { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 171 | |
| 199 | ref: 'newPermissionButton', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 172 | |
| 200 | type: 'button', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 173 | |
| 201 | className: 'btn btn-default', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 174 | |
| 202 | onClick: this.handleNewPermission }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 175 | |
| 203 | 'Add' | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 175 | |
| 204 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 175 | |
| 205 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 178 | |
| 206 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 179 | |
| 207 | ), | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 180 | |
| 208 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 181 | |
| 209 | ControlGroup, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 182 | |
| 210 | { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 182 | |
| 211 | ref: 'permissionContainer', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 183 | |
| 212 | label: 'Existing permissions', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 184 | |
| 213 | hideHelp: true }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 185 | |
| 214 | permissionsUi | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 185 | |
| 215 | ), | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 187 | |
| 216 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 188 | |
| 217 | ControlGroup, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 189 | |
| 218 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 189 | |
| 219 | React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 189 | |
| 220 | Button, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 190 | |
| 221 | { | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 190 | |
| 222 | type: 'submit', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 191 | |
| 223 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 192 | |
| 224 | disabled: this.props.data.loading }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 193 | |
| 225 | 'Save changes', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 193 | |
| 226 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 193 | |
| 227 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 196 | |
| 228 | ) | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 197 | |
| 229 | ); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 198 | |
| 230 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 199 | |
| 231 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 200 | ||
| 232 | 41 | return React.createElement( | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 202 |
| 233 | 'form', | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 203 | |
| 234 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 203 | |
| 235 | notice, | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 203 | |
| 236 | formElements | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 204 | |
| 237 | ); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 205 | |
| 238 | } | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 207 | |
| 239 | }); | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 208 | |
| 240 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 209 | ||
| 241 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 212 |
| 242 | client/pages/admin/components/admin-groups/PermissionsForm.jsx | 212 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admin-groups/Results.jsx | 1 | |
| 2 | client/pages/admin/components/admin-groups/Results.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/Results.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/admin-groups/Results.jsx | 2 |
| 5 | client/pages/admin/components/admin-groups/Results.jsx | 2 | ||
| 6 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admin-groups/Results.jsx | 5 |
| 7 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/admin-groups/Results.jsx | 6 |
| 8 | client/pages/admin/components/admin-groups/Results.jsx | 6 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/Results.jsx | 9 |
| 10 | displayName: 'Component', | client/pages/admin/components/admin-groups/Results.jsx | 9 | |
| 11 | client/pages/admin/components/admin-groups/Results.jsx | 9 | ||
| 12 | mixins: [LinkedState], | client/pages/admin/components/admin-groups/Results.jsx | 10 | |
| 13 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/admin-groups/Results.jsx | 11 | |
| 14 | client/pages/admin/components/admin-groups/Results.jsx | 11 | ||
| 15 | 1 | return { | client/pages/admin/components/admin-groups/Results.jsx | 13 |
| 16 | data: [] | client/pages/admin/components/admin-groups/Results.jsx | 14 | |
| 17 | }; | client/pages/admin/components/admin-groups/Results.jsx | 14 | |
| 18 | }, | client/pages/admin/components/admin-groups/Results.jsx | 15 | |
| 19 | render: function render() { | client/pages/admin/components/admin-groups/Results.jsx | 17 | |
| 20 | client/pages/admin/components/admin-groups/Results.jsx | 17 | ||
| 21 | 16 | var rows = this.props.data.map(function (record) { | client/pages/admin/components/admin-groups/Results.jsx | 19 |
| 22 | client/pages/admin/components/admin-groups/Results.jsx | 19 | ||
| 23 | 2 | return React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 21 |
| 24 | 'tr', | client/pages/admin/components/admin-groups/Results.jsx | 22 | |
| 25 | { key: record._id }, | client/pages/admin/components/admin-groups/Results.jsx | 22 | |
| 26 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 22 | |
| 27 | 'td', | client/pages/admin/components/admin-groups/Results.jsx | 23 | |
| 28 | null, | client/pages/admin/components/admin-groups/Results.jsx | 23 | |
| 29 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 23 | |
| 30 | Link, | client/pages/admin/components/admin-groups/Results.jsx | 24 | |
| 31 | { | client/pages/admin/components/admin-groups/Results.jsx | 24 | |
| 32 | className: 'btn btn-default btn-sm', | client/pages/admin/components/admin-groups/Results.jsx | 25 | |
| 33 | to: 'adminGroupDetails', | client/pages/admin/components/admin-groups/Results.jsx | 26 | |
| 34 | params: { id: record._id } }, | client/pages/admin/components/admin-groups/Results.jsx | 27 | |
| 35 | 'Edit' | client/pages/admin/components/admin-groups/Results.jsx | 27 | |
| 36 | ) | client/pages/admin/components/admin-groups/Results.jsx | 27 | |
| 37 | ), | client/pages/admin/components/admin-groups/Results.jsx | 30 | |
| 38 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 31 | |
| 39 | 'td', | client/pages/admin/components/admin-groups/Results.jsx | 32 | |
| 40 | null, | client/pages/admin/components/admin-groups/Results.jsx | 32 | |
| 41 | record._id | client/pages/admin/components/admin-groups/Results.jsx | 32 | |
| 42 | ), | client/pages/admin/components/admin-groups/Results.jsx | 32 | |
| 43 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 32 | |
| 44 | 'td', | client/pages/admin/components/admin-groups/Results.jsx | 33 | |
| 45 | null, | client/pages/admin/components/admin-groups/Results.jsx | 33 | |
| 46 | record.name | client/pages/admin/components/admin-groups/Results.jsx | 33 | |
| 47 | ) | client/pages/admin/components/admin-groups/Results.jsx | 33 | |
| 48 | ); | client/pages/admin/components/admin-groups/Results.jsx | 33 | |
| 49 | }); | client/pages/admin/components/admin-groups/Results.jsx | 35 | |
| 50 | client/pages/admin/components/admin-groups/Results.jsx | 36 | ||
| 51 | 16 | return React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 38 |
| 52 | 'div', | client/pages/admin/components/admin-groups/Results.jsx | 39 | |
| 53 | { className: 'table-responsive' }, | client/pages/admin/components/admin-groups/Results.jsx | 39 | |
| 54 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 39 | |
| 55 | 'table', | client/pages/admin/components/admin-groups/Results.jsx | 40 | |
| 56 | { className: 'table table-striped table-results' }, | client/pages/admin/components/admin-groups/Results.jsx | 40 | |
| 57 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 40 | |
| 58 | 'thead', | client/pages/admin/components/admin-groups/Results.jsx | 41 | |
| 59 | null, | client/pages/admin/components/admin-groups/Results.jsx | 41 | |
| 60 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 41 | |
| 61 | 'tr', | client/pages/admin/components/admin-groups/Results.jsx | 42 | |
| 62 | null, | client/pages/admin/components/admin-groups/Results.jsx | 42 | |
| 63 | React.createElement('th', null), | client/pages/admin/components/admin-groups/Results.jsx | 42 | |
| 64 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 43 | |
| 65 | 'th', | client/pages/admin/components/admin-groups/Results.jsx | 44 | |
| 66 | null, | client/pages/admin/components/admin-groups/Results.jsx | 44 | |
| 67 | 'id' | client/pages/admin/components/admin-groups/Results.jsx | 44 | |
| 68 | ), | client/pages/admin/components/admin-groups/Results.jsx | 44 | |
| 69 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 44 | |
| 70 | 'th', | client/pages/admin/components/admin-groups/Results.jsx | 45 | |
| 71 | { className: 'stretch' }, | client/pages/admin/components/admin-groups/Results.jsx | 45 | |
| 72 | 'name' | client/pages/admin/components/admin-groups/Results.jsx | 45 | |
| 73 | ) | client/pages/admin/components/admin-groups/Results.jsx | 45 | |
| 74 | ) | client/pages/admin/components/admin-groups/Results.jsx | 45 | |
| 75 | ), | client/pages/admin/components/admin-groups/Results.jsx | 46 | |
| 76 | React.createElement( | client/pages/admin/components/admin-groups/Results.jsx | 47 | |
| 77 | 'tbody', | client/pages/admin/components/admin-groups/Results.jsx | 48 | |
| 78 | null, | client/pages/admin/components/admin-groups/Results.jsx | 48 | |
| 79 | rows | client/pages/admin/components/admin-groups/Results.jsx | 48 | |
| 80 | ) | client/pages/admin/components/admin-groups/Results.jsx | 49 | |
| 81 | ) | client/pages/admin/components/admin-groups/Results.jsx | 50 | |
| 82 | ); | client/pages/admin/components/admin-groups/Results.jsx | 51 | |
| 83 | } | client/pages/admin/components/admin-groups/Results.jsx | 53 | |
| 84 | }); | client/pages/admin/components/admin-groups/Results.jsx | 54 | |
| 85 | client/pages/admin/components/admin-groups/Results.jsx | 55 | ||
| 86 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/Results.jsx | 58 |
| 87 | client/pages/admin/components/admin-groups/Results.jsx | 58 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/admin-groups/Search.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/admin-groups/Search.jsx | 2 | |
| 3 | client/pages/admin/components/admin-groups/Search.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/admin-groups/Search.jsx | 2 |
| 5 | 1 | var Paging = require('../../../../components/Paging'); | client/pages/admin/components/admin-groups/Search.jsx | 3 |
| 6 | 1 | var Actions = require('../../actions/AdminGroup'); | client/pages/admin/components/admin-groups/Search.jsx | 4 |
| 7 | 1 | var AdminGroupStore = require('../../stores/AdminGroup'); | client/pages/admin/components/admin-groups/Search.jsx | 5 |
| 8 | 1 | var FilterForm = require('./FilterForm'); | client/pages/admin/components/admin-groups/Search.jsx | 6 |
| 9 | 1 | var CreateNewForm = require('./CreateNewForm'); | client/pages/admin/components/admin-groups/Search.jsx | 7 |
| 10 | 1 | var Results = require('./Results'); | client/pages/admin/components/admin-groups/Search.jsx | 8 |
| 11 | client/pages/admin/components/admin-groups/Search.jsx | 8 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/admin-groups/Search.jsx | 11 |
| 13 | displayName: 'Component', | client/pages/admin/components/admin-groups/Search.jsx | 11 | |
| 14 | client/pages/admin/components/admin-groups/Search.jsx | 11 | ||
| 15 | contextTypes: { | client/pages/admin/components/admin-groups/Search.jsx | 12 | |
| 16 | router: React.PropTypes.func | client/pages/admin/components/admin-groups/Search.jsx | 13 | |
| 17 | }, | client/pages/admin/components/admin-groups/Search.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/admin-groups/Search.jsx | 15 | |
| 19 | client/pages/admin/components/admin-groups/Search.jsx | 15 | ||
| 20 | 8 | AdminGroupStore.resetResults(); | client/pages/admin/components/admin-groups/Search.jsx | 17 |
| 21 | 8 | AdminGroupStore.resetCreateNew(); | client/pages/admin/components/admin-groups/Search.jsx | 18 |
| 22 | client/pages/admin/components/admin-groups/Search.jsx | 18 | ||
| 23 | 8 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/admin-groups/Search.jsx | 20 |
| 24 | client/pages/admin/components/admin-groups/Search.jsx | 20 | ||
| 25 | 8 | return { | client/pages/admin/components/admin-groups/Search.jsx | 22 |
| 26 | results: AdminGroupStore.getResults(), | client/pages/admin/components/admin-groups/Search.jsx | 23 | |
| 27 | createNew: AdminGroupStore.getCreateNew() | client/pages/admin/components/admin-groups/Search.jsx | 24 | |
| 28 | }; | client/pages/admin/components/admin-groups/Search.jsx | 24 | |
| 29 | }, | client/pages/admin/components/admin-groups/Search.jsx | 25 | |
| 30 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admin-groups/Search.jsx | 27 | |
| 31 | client/pages/admin/components/admin-groups/Search.jsx | 27 | ||
| 32 | 1 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/admin-groups/Search.jsx | 29 |
| 33 | }, | client/pages/admin/components/admin-groups/Search.jsx | 29 | |
| 34 | componentDidMount: function componentDidMount() { | client/pages/admin/components/admin-groups/Search.jsx | 31 | |
| 35 | client/pages/admin/components/admin-groups/Search.jsx | 31 | ||
| 36 | 8 | AdminGroupStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/admin-groups/Search.jsx | 33 |
| 37 | }, | client/pages/admin/components/admin-groups/Search.jsx | 33 | |
| 38 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/admin-groups/Search.jsx | 35 | |
| 39 | client/pages/admin/components/admin-groups/Search.jsx | 35 | ||
| 40 | 1 | AdminGroupStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/admin-groups/Search.jsx | 37 |
| 41 | }, | client/pages/admin/components/admin-groups/Search.jsx | 37 | |
| 42 | onStoreChange: function onStoreChange() { | client/pages/admin/components/admin-groups/Search.jsx | 39 | |
| 43 | client/pages/admin/components/admin-groups/Search.jsx | 39 | ||
| 44 | 3 | this.setState({ | client/pages/admin/components/admin-groups/Search.jsx | 41 |
| 45 | results: AdminGroupStore.getResults(), | client/pages/admin/components/admin-groups/Search.jsx | 42 | |
| 46 | createNew: AdminGroupStore.getCreateNew() | client/pages/admin/components/admin-groups/Search.jsx | 43 | |
| 47 | }); | client/pages/admin/components/admin-groups/Search.jsx | 43 | |
| 48 | }, | client/pages/admin/components/admin-groups/Search.jsx | 44 | |
| 49 | onFiltersChange: function onFiltersChange(event) { | client/pages/admin/components/admin-groups/Search.jsx | 46 | |
| 50 | client/pages/admin/components/admin-groups/Search.jsx | 46 | ||
| 51 | 3 | if (event) { | client/pages/admin/components/admin-groups/Search.jsx | 48 |
| 52 | 1 | event.preventDefault(); | client/pages/admin/components/admin-groups/Search.jsx | 49 |
| 53 | 1 | event.stopPropagation(); | client/pages/admin/components/admin-groups/Search.jsx | 50 |
| 54 | } | client/pages/admin/components/admin-groups/Search.jsx | 50 | |
| 55 | client/pages/admin/components/admin-groups/Search.jsx | 51 | ||
| 56 | 3 | this.context.router.transitionTo('adminGroups', {}, this.refs.filters.state); | client/pages/admin/components/admin-groups/Search.jsx | 53 |
| 57 | 3 | window.scrollTo(0, 0); | client/pages/admin/components/admin-groups/Search.jsx | 54 |
| 58 | }, | client/pages/admin/components/admin-groups/Search.jsx | 54 | |
| 59 | onPageChange: function onPageChange(page) { | client/pages/admin/components/admin-groups/Search.jsx | 56 | |
| 60 | client/pages/admin/components/admin-groups/Search.jsx | 56 | ||
| 61 | 1 | this.refs.filters.changePage(page); | client/pages/admin/components/admin-groups/Search.jsx | 58 |
| 62 | }, | client/pages/admin/components/admin-groups/Search.jsx | 58 | |
| 63 | onNewClick: function onNewClick() { | client/pages/admin/components/admin-groups/Search.jsx | 60 | |
| 64 | client/pages/admin/components/admin-groups/Search.jsx | 60 | ||
| 65 | 1 | Actions.showCreateNew(); | client/pages/admin/components/admin-groups/Search.jsx | 62 |
| 66 | }, | client/pages/admin/components/admin-groups/Search.jsx | 62 | |
| 67 | render: function render() { | client/pages/admin/components/admin-groups/Search.jsx | 64 | |
| 68 | client/pages/admin/components/admin-groups/Search.jsx | 64 | ||
| 69 | 13 | return React.createElement( | client/pages/admin/components/admin-groups/Search.jsx | 66 |
| 70 | 'section', | client/pages/admin/components/admin-groups/Search.jsx | 67 | |
| 71 | { className: 'section-admin-groups container' }, | client/pages/admin/components/admin-groups/Search.jsx | 67 | |
| 72 | React.createElement( | client/pages/admin/components/admin-groups/Search.jsx | 67 | |
| 73 | 'div', | client/pages/admin/components/admin-groups/Search.jsx | 68 | |
| 74 | { className: 'page-header' }, | client/pages/admin/components/admin-groups/Search.jsx | 68 | |
| 75 | React.createElement( | client/pages/admin/components/admin-groups/Search.jsx | 68 | |
| 76 | 'button', | client/pages/admin/components/admin-groups/Search.jsx | 69 | |
| 77 | { | client/pages/admin/components/admin-groups/Search.jsx | 69 | |
| 78 | ref: 'createNew', | client/pages/admin/components/admin-groups/Search.jsx | 70 | |
| 79 | className: 'btn btn-default pull-right', | client/pages/admin/components/admin-groups/Search.jsx | 71 | |
| 80 | onClick: this.onNewClick }, | client/pages/admin/components/admin-groups/Search.jsx | 72 | |
| 81 | 'Create new' | client/pages/admin/components/admin-groups/Search.jsx | 72 | |
| 82 | ), | client/pages/admin/components/admin-groups/Search.jsx | 72 | |
| 83 | React.createElement( | client/pages/admin/components/admin-groups/Search.jsx | 75 | |
| 84 | 'h1', | client/pages/admin/components/admin-groups/Search.jsx | 76 | |
| 85 | null, | client/pages/admin/components/admin-groups/Search.jsx | 76 | |
| 86 | 'Admin Groups' | client/pages/admin/components/admin-groups/Search.jsx | 76 | |
| 87 | ) | client/pages/admin/components/admin-groups/Search.jsx | 76 | |
| 88 | ), | client/pages/admin/components/admin-groups/Search.jsx | 76 | |
| 89 | React.createElement(FilterForm, { | client/pages/admin/components/admin-groups/Search.jsx | 77 | |
| 90 | ref: 'filters', | client/pages/admin/components/admin-groups/Search.jsx | 79 | |
| 91 | query: this.context.router.getCurrentQuery(), | client/pages/admin/components/admin-groups/Search.jsx | 80 | |
| 92 | loading: this.state.results.loading, | client/pages/admin/components/admin-groups/Search.jsx | 81 | |
| 93 | onChange: this.onFiltersChange | client/pages/admin/components/admin-groups/Search.jsx | 82 | |
| 94 | }), | client/pages/admin/components/admin-groups/Search.jsx | 82 | |
| 95 | React.createElement(Results, { data: this.state.results.data }), | client/pages/admin/components/admin-groups/Search.jsx | 83 | |
| 96 | React.createElement(Paging, { | client/pages/admin/components/admin-groups/Search.jsx | 84 | |
| 97 | ref: 'paging', | client/pages/admin/components/admin-groups/Search.jsx | 86 | |
| 98 | pages: this.state.results.pages, | client/pages/admin/components/admin-groups/Search.jsx | 87 | |
| 99 | items: this.state.results.items, | client/pages/admin/components/admin-groups/Search.jsx | 88 | |
| 100 | loading: this.state.results.loading, | client/pages/admin/components/admin-groups/Search.jsx | 89 | |
| 101 | onChange: this.onPageChange | client/pages/admin/components/admin-groups/Search.jsx | 90 | |
| 102 | }), | client/pages/admin/components/admin-groups/Search.jsx | 90 | |
| 103 | React.createElement(CreateNewForm, { data: this.state.createNew }) | client/pages/admin/components/admin-groups/Search.jsx | 91 | |
| 104 | ); | client/pages/admin/components/admin-groups/Search.jsx | 92 | |
| 105 | } | client/pages/admin/components/admin-groups/Search.jsx | 94 | |
| 106 | }); | client/pages/admin/components/admin-groups/Search.jsx | 95 | |
| 107 | client/pages/admin/components/admin-groups/Search.jsx | 96 | ||
| 108 | 1 | module.exports = Component; | client/pages/admin/components/admin-groups/Search.jsx | 99 |
| 109 | client/pages/admin/components/admin-groups/Search.jsx | 99 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admins/CreateNewForm.jsx | 1 | |
| 2 | client/pages/admin/components/admins/CreateNewForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/CreateNewForm.jsx | 1 |
| 4 | 1 | var Modal = require('../../../../components/Modal'); | client/pages/admin/components/admins/CreateNewForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admins/CreateNewForm.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/admins/CreateNewForm.jsx | 4 |
| 7 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admins/CreateNewForm.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admins/CreateNewForm.jsx | 6 |
| 9 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/CreateNewForm.jsx | 7 |
| 10 | client/pages/admin/components/admins/CreateNewForm.jsx | 7 | ||
| 11 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admins/CreateNewForm.jsx | 10 |
| 12 | client/pages/admin/components/admins/CreateNewForm.jsx | 10 | ||
| 13 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/CreateNewForm.jsx | 13 |
| 14 | displayName: 'Component', | client/pages/admin/components/admins/CreateNewForm.jsx | 13 | |
| 15 | client/pages/admin/components/admins/CreateNewForm.jsx | 13 | ||
| 16 | mixins: [LinkedState], | client/pages/admin/components/admins/CreateNewForm.jsx | 14 | |
| 17 | contextTypes: { | client/pages/admin/components/admins/CreateNewForm.jsx | 15 | |
| 18 | router: React.PropTypes.func | client/pages/admin/components/admins/CreateNewForm.jsx | 16 | |
| 19 | }, | client/pages/admin/components/admins/CreateNewForm.jsx | 16 | |
| 20 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/admins/CreateNewForm.jsx | 18 | |
| 21 | client/pages/admin/components/admins/CreateNewForm.jsx | 18 | ||
| 22 | 1 | return { | client/pages/admin/components/admins/CreateNewForm.jsx | 20 |
| 23 | data: { | client/pages/admin/components/admins/CreateNewForm.jsx | 21 | |
| 24 | hasError: {}, | client/pages/admin/components/admins/CreateNewForm.jsx | 22 | |
| 25 | help: {} | client/pages/admin/components/admins/CreateNewForm.jsx | 23 | |
| 26 | } | client/pages/admin/components/admins/CreateNewForm.jsx | 23 | |
| 27 | }; | client/pages/admin/components/admins/CreateNewForm.jsx | 24 | |
| 28 | }, | client/pages/admin/components/admins/CreateNewForm.jsx | 25 | |
| 29 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/CreateNewForm.jsx | 27 | |
| 30 | client/pages/admin/components/admins/CreateNewForm.jsx | 27 | ||
| 31 | 15 | return {}; | client/pages/admin/components/admins/CreateNewForm.jsx | 29 |
| 32 | }, | client/pages/admin/components/admins/CreateNewForm.jsx | 29 | |
| 33 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/admins/CreateNewForm.jsx | 31 | |
| 34 | client/pages/admin/components/admins/CreateNewForm.jsx | 31 | ||
| 35 | 2 | clearTimeout(this.timeout); | client/pages/admin/components/admins/CreateNewForm.jsx | 33 |
| 36 | }, | client/pages/admin/components/admins/CreateNewForm.jsx | 33 | |
| 37 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admins/CreateNewForm.jsx | 35 | |
| 38 | client/pages/admin/components/admins/CreateNewForm.jsx | 35 | ||
| 39 | 9 | if (!nextProps.data.show) { | client/pages/admin/components/admins/CreateNewForm.jsx | 37 |
| 40 | 8 | this.replaceState({}); | client/pages/admin/components/admins/CreateNewForm.jsx | 38 |
| 41 | } else { | client/pages/admin/components/admins/CreateNewForm.jsx | 38 | |
| 42 | 1 | this.timeout = setTimeout((function () { | client/pages/admin/components/admins/CreateNewForm.jsx | 41 |
| 43 | client/pages/admin/components/admins/CreateNewForm.jsx | 41 | ||
| 44 | 1 | this.refs.name.refs.inputField.getDOMNode().focus(); | client/pages/admin/components/admins/CreateNewForm.jsx | 43 |
| 45 | }).bind(this), 100); | client/pages/admin/components/admins/CreateNewForm.jsx | 43 | |
| 46 | } | client/pages/admin/components/admins/CreateNewForm.jsx | 44 | |
| 47 | }, | client/pages/admin/components/admins/CreateNewForm.jsx | 45 | |
| 48 | onSubmit: function onSubmit(event) { | client/pages/admin/components/admins/CreateNewForm.jsx | 47 | |
| 49 | client/pages/admin/components/admins/CreateNewForm.jsx | 47 | ||
| 50 | 1 | event.preventDefault(); | client/pages/admin/components/admins/CreateNewForm.jsx | 49 |
| 51 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/CreateNewForm.jsx | 50 |
| 52 | client/pages/admin/components/admins/CreateNewForm.jsx | 50 | ||
| 53 | 1 | Actions.createNew({ | client/pages/admin/components/admins/CreateNewForm.jsx | 52 |
| 54 | name: this.state.name | client/pages/admin/components/admins/CreateNewForm.jsx | 53 | |
| 55 | }, this.context.router); | client/pages/admin/components/admins/CreateNewForm.jsx | 53 | |
| 56 | }, | client/pages/admin/components/admins/CreateNewForm.jsx | 54 | |
| 57 | render: function render() { | client/pages/admin/components/admins/CreateNewForm.jsx | 56 | |
| 58 | client/pages/admin/components/admins/CreateNewForm.jsx | 56 | ||
| 59 | 24 | var alerts; | client/pages/admin/components/admins/CreateNewForm.jsx | 58 |
| 60 | 24 | if (this.props.data.error) { | client/pages/admin/components/admins/CreateNewForm.jsx | 59 |
| 61 | 1 | alerts = React.createElement( | client/pages/admin/components/admins/CreateNewForm.jsx | 60 |
| 62 | 'div', | client/pages/admin/components/admins/CreateNewForm.jsx | 60 | |
| 63 | { className: 'alert alert-danger' }, | client/pages/admin/components/admins/CreateNewForm.jsx | 60 | |
| 64 | this.props.data.error | client/pages/admin/components/admins/CreateNewForm.jsx | 60 | |
| 65 | ); | client/pages/admin/components/admins/CreateNewForm.jsx | 61 | |
| 66 | } | client/pages/admin/components/admins/CreateNewForm.jsx | 62 | |
| 67 | client/pages/admin/components/admins/CreateNewForm.jsx | 63 | ||
| 68 | 24 | var notice; | client/pages/admin/components/admins/CreateNewForm.jsx | 65 |
| 69 | 24 | if (this.props.data.success) { | client/pages/admin/components/admins/CreateNewForm.jsx | 66 |
| 70 | 1 | notice = React.createElement( | client/pages/admin/components/admins/CreateNewForm.jsx | 67 |
| 71 | 'div', | client/pages/admin/components/admins/CreateNewForm.jsx | 67 | |
| 72 | { className: 'alert alert-success' }, | client/pages/admin/components/admins/CreateNewForm.jsx | 67 | |
| 73 | 'Loading data...' | client/pages/admin/components/admins/CreateNewForm.jsx | 67 | |
| 74 | ); | client/pages/admin/components/admins/CreateNewForm.jsx | 67 | |
| 75 | } | client/pages/admin/components/admins/CreateNewForm.jsx | 69 | |
| 76 | client/pages/admin/components/admins/CreateNewForm.jsx | 70 | ||
| 77 | 24 | var formElements; | client/pages/admin/components/admins/CreateNewForm.jsx | 72 |
| 78 | 24 | if (!this.props.data.success) { | client/pages/admin/components/admins/CreateNewForm.jsx | 73 |
| 79 | 23 | formElements = React.createElement( | client/pages/admin/components/admins/CreateNewForm.jsx | 74 |
| 80 | 'fieldset', | client/pages/admin/components/admins/CreateNewForm.jsx | 74 | |
| 81 | null, | client/pages/admin/components/admins/CreateNewForm.jsx | 74 | |
| 82 | alerts, | client/pages/admin/components/admins/CreateNewForm.jsx | 74 | |
| 83 | React.createElement(TextControl, { | client/pages/admin/components/admins/CreateNewForm.jsx | 75 | |
| 84 | name: 'name', | client/pages/admin/components/admins/CreateNewForm.jsx | 77 | |
| 85 | ref: 'name', | client/pages/admin/components/admins/CreateNewForm.jsx | 78 | |
| 86 | label: 'Name', | client/pages/admin/components/admins/CreateNewForm.jsx | 79 | |
| 87 | hasError: this.props.data.hasError.name, | client/pages/admin/components/admins/CreateNewForm.jsx | 80 | |
| 88 | valueLink: this.linkState('name'), | client/pages/admin/components/admins/CreateNewForm.jsx | 81 | |
| 89 | help: this.props.data.help.name, | client/pages/admin/components/admins/CreateNewForm.jsx | 82 | |
| 90 | disabled: this.props.data.loading | client/pages/admin/components/admins/CreateNewForm.jsx | 83 | |
| 91 | }), | client/pages/admin/components/admins/CreateNewForm.jsx | 83 | |
| 92 | React.createElement( | client/pages/admin/components/admins/CreateNewForm.jsx | 84 | |
| 93 | ControlGroup, | client/pages/admin/components/admins/CreateNewForm.jsx | 85 | |
| 94 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admins/CreateNewForm.jsx | 85 | |
| 95 | React.createElement( | client/pages/admin/components/admins/CreateNewForm.jsx | 85 | |
| 96 | Button, | client/pages/admin/components/admins/CreateNewForm.jsx | 86 | |
| 97 | { | client/pages/admin/components/admins/CreateNewForm.jsx | 86 | |
| 98 | type: 'submit', | client/pages/admin/components/admins/CreateNewForm.jsx | 87 | |
| 99 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/admins/CreateNewForm.jsx | 88 | |
| 100 | disabled: this.props.data.loading }, | client/pages/admin/components/admins/CreateNewForm.jsx | 89 | |
| 101 | 'Create new', | client/pages/admin/components/admins/CreateNewForm.jsx | 89 | |
| 102 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admins/CreateNewForm.jsx | 89 | |
| 103 | ) | client/pages/admin/components/admins/CreateNewForm.jsx | 92 | |
| 104 | ) | client/pages/admin/components/admins/CreateNewForm.jsx | 93 | |
| 105 | ); | client/pages/admin/components/admins/CreateNewForm.jsx | 94 | |
| 106 | } | client/pages/admin/components/admins/CreateNewForm.jsx | 95 | |
| 107 | client/pages/admin/components/admins/CreateNewForm.jsx | 96 | ||
| 108 | 24 | return React.createElement( | client/pages/admin/components/admins/CreateNewForm.jsx | 98 |
| 109 | Modal, | client/pages/admin/components/admins/CreateNewForm.jsx | 99 | |
| 110 | { | client/pages/admin/components/admins/CreateNewForm.jsx | 99 | |
| 111 | header: 'Create new', | client/pages/admin/components/admins/CreateNewForm.jsx | 100 | |
| 112 | show: this.props.data.show, | client/pages/admin/components/admins/CreateNewForm.jsx | 101 | |
| 113 | onClose: Actions.hideCreateNew }, | client/pages/admin/components/admins/CreateNewForm.jsx | 102 | |
| 114 | React.createElement( | client/pages/admin/components/admins/CreateNewForm.jsx | 102 | |
| 115 | 'form', | client/pages/admin/components/admins/CreateNewForm.jsx | 104 | |
| 116 | { onSubmit: this.onSubmit }, | client/pages/admin/components/admins/CreateNewForm.jsx | 104 | |
| 117 | notice, | client/pages/admin/components/admins/CreateNewForm.jsx | 104 | |
| 118 | formElements | client/pages/admin/components/admins/CreateNewForm.jsx | 105 | |
| 119 | ) | client/pages/admin/components/admins/CreateNewForm.jsx | 106 | |
| 120 | ); | client/pages/admin/components/admins/CreateNewForm.jsx | 107 | |
| 121 | } | client/pages/admin/components/admins/CreateNewForm.jsx | 109 | |
| 122 | }); | client/pages/admin/components/admins/CreateNewForm.jsx | 110 | |
| 123 | client/pages/admin/components/admins/CreateNewForm.jsx | 111 | ||
| 124 | 1 | module.exports = Component; | client/pages/admin/components/admins/CreateNewForm.jsx | 114 |
| 125 | client/pages/admin/components/admins/CreateNewForm.jsx | 114 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/admins/DeleteForm.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/admins/DeleteForm.jsx | 2 | |
| 3 | client/pages/admin/components/admins/DeleteForm.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/DeleteForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admins/DeleteForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admins/DeleteForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admins/DeleteForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/DeleteForm.jsx | 6 |
| 9 | client/pages/admin/components/admins/DeleteForm.jsx | 6 | ||
| 10 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admins/DeleteForm.jsx | 9 |
| 11 | client/pages/admin/components/admins/DeleteForm.jsx | 9 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/DeleteForm.jsx | 12 |
| 13 | displayName: 'Component', | client/pages/admin/components/admins/DeleteForm.jsx | 12 | |
| 14 | client/pages/admin/components/admins/DeleteForm.jsx | 12 | ||
| 15 | mixins: [LinkedState], | client/pages/admin/components/admins/DeleteForm.jsx | 13 | |
| 16 | contextTypes: { | client/pages/admin/components/admins/DeleteForm.jsx | 14 | |
| 17 | router: React.PropTypes.func | client/pages/admin/components/admins/DeleteForm.jsx | 15 | |
| 18 | }, | client/pages/admin/components/admins/DeleteForm.jsx | 15 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/DeleteForm.jsx | 17 | |
| 20 | client/pages/admin/components/admins/DeleteForm.jsx | 17 | ||
| 21 | 10 | return {}; | client/pages/admin/components/admins/DeleteForm.jsx | 19 |
| 22 | }, | client/pages/admin/components/admins/DeleteForm.jsx | 19 | |
| 23 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admins/DeleteForm.jsx | 21 | |
| 24 | client/pages/admin/components/admins/DeleteForm.jsx | 21 | ||
| 25 | 1 | event.preventDefault(); | client/pages/admin/components/admins/DeleteForm.jsx | 23 |
| 26 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/DeleteForm.jsx | 24 |
| 27 | client/pages/admin/components/admins/DeleteForm.jsx | 24 | ||
| 28 | 1 | Actions['delete']({ | client/pages/admin/components/admins/DeleteForm.jsx | 26 |
| 29 | id: this.props.details._id | client/pages/admin/components/admins/DeleteForm.jsx | 27 | |
| 30 | }, this.context.router); | client/pages/admin/components/admins/DeleteForm.jsx | 27 | |
| 31 | }, | client/pages/admin/components/admins/DeleteForm.jsx | 28 | |
| 32 | onConfirm: function onConfirm(event) { | client/pages/admin/components/admins/DeleteForm.jsx | 30 | |
| 33 | client/pages/admin/components/admins/DeleteForm.jsx | 30 | ||
| 34 | 2 | if (!window.confirm('Are you sure?')) { | client/pages/admin/components/admins/DeleteForm.jsx | 32 |
| 35 | 1 | event.preventDefault(); | client/pages/admin/components/admins/DeleteForm.jsx | 33 |
| 36 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/DeleteForm.jsx | 34 |
| 37 | } | client/pages/admin/components/admins/DeleteForm.jsx | 34 | |
| 38 | }, | client/pages/admin/components/admins/DeleteForm.jsx | 35 | |
| 39 | render: function render() { | client/pages/admin/components/admins/DeleteForm.jsx | 37 | |
| 40 | client/pages/admin/components/admins/DeleteForm.jsx | 37 | ||
| 41 | 16 | var alerts; | client/pages/admin/components/admins/DeleteForm.jsx | 39 |
| 42 | 16 | if (this.props.data.error) { | client/pages/admin/components/admins/DeleteForm.jsx | 40 |
| 43 | 1 | alerts = React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 41 |
| 44 | 'div', | client/pages/admin/components/admins/DeleteForm.jsx | 41 | |
| 45 | { className: 'alert alert-danger' }, | client/pages/admin/components/admins/DeleteForm.jsx | 41 | |
| 46 | this.props.data.error | client/pages/admin/components/admins/DeleteForm.jsx | 41 | |
| 47 | ); | client/pages/admin/components/admins/DeleteForm.jsx | 42 | |
| 48 | } | client/pages/admin/components/admins/DeleteForm.jsx | 43 | |
| 49 | client/pages/admin/components/admins/DeleteForm.jsx | 44 | ||
| 50 | 16 | return React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 46 |
| 51 | 'form', | client/pages/admin/components/admins/DeleteForm.jsx | 47 | |
| 52 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admins/DeleteForm.jsx | 47 | |
| 53 | React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 47 | |
| 54 | 'fieldset', | client/pages/admin/components/admins/DeleteForm.jsx | 48 | |
| 55 | null, | client/pages/admin/components/admins/DeleteForm.jsx | 48 | |
| 56 | React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 48 | |
| 57 | 'legend', | client/pages/admin/components/admins/DeleteForm.jsx | 49 | |
| 58 | null, | client/pages/admin/components/admins/DeleteForm.jsx | 49 | |
| 59 | 'Danger zone' | client/pages/admin/components/admins/DeleteForm.jsx | 49 | |
| 60 | ), | client/pages/admin/components/admins/DeleteForm.jsx | 49 | |
| 61 | React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 49 | |
| 62 | 'p', | client/pages/admin/components/admins/DeleteForm.jsx | 50 | |
| 63 | null, | client/pages/admin/components/admins/DeleteForm.jsx | 50 | |
| 64 | React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 50 | |
| 65 | 'span', | client/pages/admin/components/admins/DeleteForm.jsx | 51 | |
| 66 | { className: 'label label-danger' }, | client/pages/admin/components/admins/DeleteForm.jsx | 51 | |
| 67 | 'Warning' | client/pages/admin/components/admins/DeleteForm.jsx | 51 | |
| 68 | ), | client/pages/admin/components/admins/DeleteForm.jsx | 51 | |
| 69 | 'Â This cannot be undone and could result in orphaned document relationships.' | client/pages/admin/components/admins/DeleteForm.jsx | 51 | |
| 70 | ), | client/pages/admin/components/admins/DeleteForm.jsx | 51 | |
| 71 | alerts, | client/pages/admin/components/admins/DeleteForm.jsx | 54 | |
| 72 | React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 55 | |
| 73 | ControlGroup, | client/pages/admin/components/admins/DeleteForm.jsx | 56 | |
| 74 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admins/DeleteForm.jsx | 56 | |
| 75 | React.createElement( | client/pages/admin/components/admins/DeleteForm.jsx | 56 | |
| 76 | Button, | client/pages/admin/components/admins/DeleteForm.jsx | 57 | |
| 77 | { | client/pages/admin/components/admins/DeleteForm.jsx | 57 | |
| 78 | type: 'submit', | client/pages/admin/components/admins/DeleteForm.jsx | 58 | |
| 79 | inputClasses: { 'btn-danger': true }, | client/pages/admin/components/admins/DeleteForm.jsx | 59 | |
| 80 | disabled: this.props.data.loading, | client/pages/admin/components/admins/DeleteForm.jsx | 60 | |
| 81 | onClick: this.onConfirm }, | client/pages/admin/components/admins/DeleteForm.jsx | 61 | |
| 82 | 'Delete', | client/pages/admin/components/admins/DeleteForm.jsx | 61 | |
| 83 | React.createElement(Spinner, { | client/pages/admin/components/admins/DeleteForm.jsx | 61 | |
| 84 | space: 'left', | client/pages/admin/components/admins/DeleteForm.jsx | 65 | |
| 85 | show: this.props.data.loading | client/pages/admin/components/admins/DeleteForm.jsx | 66 | |
| 86 | }) | client/pages/admin/components/admins/DeleteForm.jsx | 66 | |
| 87 | ) | client/pages/admin/components/admins/DeleteForm.jsx | 67 | |
| 88 | ) | client/pages/admin/components/admins/DeleteForm.jsx | 68 | |
| 89 | ) | client/pages/admin/components/admins/DeleteForm.jsx | 69 | |
| 90 | ); | client/pages/admin/components/admins/DeleteForm.jsx | 70 | |
| 91 | } | client/pages/admin/components/admins/DeleteForm.jsx | 72 | |
| 92 | }); | client/pages/admin/components/admins/DeleteForm.jsx | 73 | |
| 93 | client/pages/admin/components/admins/DeleteForm.jsx | 74 | ||
| 94 | 1 | module.exports = Component; | client/pages/admin/components/admins/DeleteForm.jsx | 77 |
| 95 | client/pages/admin/components/admins/DeleteForm.jsx | 77 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admins/Details.jsx | 1 | |
| 2 | client/pages/admin/components/admins/Details.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/Details.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/admins/Details.jsx | 2 |
| 5 | 1 | var DetailsForm = require('./DetailsForm'); | client/pages/admin/components/admins/Details.jsx | 3 |
| 6 | 1 | var UserForm = require('./UserForm'); | client/pages/admin/components/admins/Details.jsx | 4 |
| 7 | 1 | var GroupsForm = require('./GroupsForm'); | client/pages/admin/components/admins/Details.jsx | 5 |
| 8 | 1 | var PermissionsForm = require('./PermissionsForm'); | client/pages/admin/components/admins/Details.jsx | 6 |
| 9 | 1 | var DeleteForm = require('./DeleteForm'); | client/pages/admin/components/admins/Details.jsx | 7 |
| 10 | 1 | var AdminStore = require('../../stores/Admin'); | client/pages/admin/components/admins/Details.jsx | 8 |
| 11 | 1 | var AdminGroupStore = require('../../stores/AdminGroup'); | client/pages/admin/components/admins/Details.jsx | 9 |
| 12 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/Details.jsx | 10 |
| 13 | 1 | var GroupActions = require('../../actions/AdminGroup'); | client/pages/admin/components/admins/Details.jsx | 11 |
| 14 | client/pages/admin/components/admins/Details.jsx | 11 | ||
| 15 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admins/Details.jsx | 14 |
| 16 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/admins/Details.jsx | 15 |
| 17 | client/pages/admin/components/admins/Details.jsx | 15 | ||
| 18 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/Details.jsx | 18 |
| 19 | displayName: 'Component', | client/pages/admin/components/admins/Details.jsx | 18 | |
| 20 | client/pages/admin/components/admins/Details.jsx | 18 | ||
| 21 | mixins: [LinkedState], | client/pages/admin/components/admins/Details.jsx | 19 | |
| 22 | contextTypes: { | client/pages/admin/components/admins/Details.jsx | 20 | |
| 23 | router: React.PropTypes.func | client/pages/admin/components/admins/Details.jsx | 21 | |
| 24 | }, | client/pages/admin/components/admins/Details.jsx | 21 | |
| 25 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/Details.jsx | 23 | |
| 26 | client/pages/admin/components/admins/Details.jsx | 23 | ||
| 27 | 4 | AdminStore.resetDetails(); | client/pages/admin/components/admins/Details.jsx | 25 |
| 28 | 4 | AdminStore.resetPermissions(); | client/pages/admin/components/admins/Details.jsx | 26 |
| 29 | 4 | AdminStore.resetUser(); | client/pages/admin/components/admins/Details.jsx | 27 |
| 30 | 4 | AdminStore.resetGroups(); | client/pages/admin/components/admins/Details.jsx | 28 |
| 31 | 4 | AdminStore.resetDelete(); | client/pages/admin/components/admins/Details.jsx | 29 |
| 32 | 4 | AdminGroupStore.resetResults(); | client/pages/admin/components/admins/Details.jsx | 30 |
| 33 | client/pages/admin/components/admins/Details.jsx | 30 | ||
| 34 | 4 | Actions.getDetails(this.context.router.getCurrentParams()); | client/pages/admin/components/admins/Details.jsx | 32 |
| 35 | 4 | GroupActions.getResults({ fields: 'name', limit: 99 }); | client/pages/admin/components/admins/Details.jsx | 33 |
| 36 | client/pages/admin/components/admins/Details.jsx | 33 | ||
| 37 | 4 | return { | client/pages/admin/components/admins/Details.jsx | 35 |
| 38 | details: AdminStore.getDetails(), | client/pages/admin/components/admins/Details.jsx | 36 | |
| 39 | permissions: AdminStore.getPermissions(), | client/pages/admin/components/admins/Details.jsx | 37 | |
| 40 | user: AdminStore.getUser(), | client/pages/admin/components/admins/Details.jsx | 38 | |
| 41 | groups: AdminStore.getGroups(), | client/pages/admin/components/admins/Details.jsx | 39 | |
| 42 | 'delete': AdminStore.getDelete(), | client/pages/admin/components/admins/Details.jsx | 40 | |
| 43 | adminGroups: AdminGroupStore.getResults() | client/pages/admin/components/admins/Details.jsx | 41 | |
| 44 | }; | client/pages/admin/components/admins/Details.jsx | 41 | |
| 45 | }, | client/pages/admin/components/admins/Details.jsx | 42 | |
| 46 | componentDidMount: function componentDidMount() { | client/pages/admin/components/admins/Details.jsx | 44 | |
| 47 | client/pages/admin/components/admins/Details.jsx | 44 | ||
| 48 | 4 | AdminStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/admins/Details.jsx | 46 |
| 49 | 4 | AdminGroupStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/admins/Details.jsx | 47 |
| 50 | }, | client/pages/admin/components/admins/Details.jsx | 47 | |
| 51 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/admins/Details.jsx | 49 | |
| 52 | client/pages/admin/components/admins/Details.jsx | 49 | ||
| 53 | 1 | AdminStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/admins/Details.jsx | 51 |
| 54 | 1 | AdminGroupStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/admins/Details.jsx | 52 |
| 55 | }, | client/pages/admin/components/admins/Details.jsx | 52 | |
| 56 | onStoreChange: function onStoreChange() { | client/pages/admin/components/admins/Details.jsx | 54 | |
| 57 | client/pages/admin/components/admins/Details.jsx | 54 | ||
| 58 | 2 | this.setState({ | client/pages/admin/components/admins/Details.jsx | 56 |
| 59 | details: AdminStore.getDetails(), | client/pages/admin/components/admins/Details.jsx | 57 | |
| 60 | user: AdminStore.getUser(), | client/pages/admin/components/admins/Details.jsx | 58 | |
| 61 | groups: AdminStore.getGroups(), | client/pages/admin/components/admins/Details.jsx | 59 | |
| 62 | permissions: AdminStore.getPermissions(), | client/pages/admin/components/admins/Details.jsx | 60 | |
| 63 | 'delete': AdminStore.getDelete(), | client/pages/admin/components/admins/Details.jsx | 61 | |
| 64 | adminGroups: AdminGroupStore.getResults() | client/pages/admin/components/admins/Details.jsx | 62 | |
| 65 | }); | client/pages/admin/components/admins/Details.jsx | 62 | |
| 66 | }, | client/pages/admin/components/admins/Details.jsx | 63 | |
| 67 | render: function render() { | client/pages/admin/components/admins/Details.jsx | 65 | |
| 68 | client/pages/admin/components/admins/Details.jsx | 65 | ||
| 69 | 7 | if (this.state.details.hydrated && this.state.details.fetchFailure) { | client/pages/admin/components/admins/Details.jsx | 67 |
| 70 | 1 | return React.createElement( | client/pages/admin/components/admins/Details.jsx | 68 |
| 71 | 'section', | client/pages/admin/components/admins/Details.jsx | 69 | |
| 72 | { className: 'section-admin-details container' }, | client/pages/admin/components/admins/Details.jsx | 69 | |
| 73 | React.createElement( | client/pages/admin/components/admins/Details.jsx | 69 | |
| 74 | 'h1', | client/pages/admin/components/admins/Details.jsx | 70 | |
| 75 | { className: 'page-header' }, | client/pages/admin/components/admins/Details.jsx | 70 | |
| 76 | React.createElement( | client/pages/admin/components/admins/Details.jsx | 70 | |
| 77 | Link, | client/pages/admin/components/admins/Details.jsx | 71 | |
| 78 | { to: 'admins' }, | client/pages/admin/components/admins/Details.jsx | 71 | |
| 79 | 'Admins' | client/pages/admin/components/admins/Details.jsx | 71 | |
| 80 | ), | client/pages/admin/components/admins/Details.jsx | 71 | |
| 81 | ' / Error' | client/pages/admin/components/admins/Details.jsx | 71 | |
| 82 | ), | client/pages/admin/components/admins/Details.jsx | 71 | |
| 83 | React.createElement( | client/pages/admin/components/admins/Details.jsx | 72 | |
| 84 | 'div', | client/pages/admin/components/admins/Details.jsx | 73 | |
| 85 | { className: 'alert alert-danger' }, | client/pages/admin/components/admins/Details.jsx | 73 | |
| 86 | this.state.details.error | client/pages/admin/components/admins/Details.jsx | 73 | |
| 87 | ) | client/pages/admin/components/admins/Details.jsx | 74 | |
| 88 | ); | client/pages/admin/components/admins/Details.jsx | 75 | |
| 89 | } | client/pages/admin/components/admins/Details.jsx | 77 | |
| 90 | client/pages/admin/components/admins/Details.jsx | 78 | ||
| 91 | 6 | return React.createElement( | client/pages/admin/components/admins/Details.jsx | 80 |
| 92 | 'section', | client/pages/admin/components/admins/Details.jsx | 81 | |
| 93 | { className: 'section-admin-details container' }, | client/pages/admin/components/admins/Details.jsx | 81 | |
| 94 | React.createElement( | client/pages/admin/components/admins/Details.jsx | 81 | |
| 95 | 'h1', | client/pages/admin/components/admins/Details.jsx | 82 | |
| 96 | { className: 'page-header' }, | client/pages/admin/components/admins/Details.jsx | 82 | |
| 97 | React.createElement( | client/pages/admin/components/admins/Details.jsx | 82 | |
| 98 | Link, | client/pages/admin/components/admins/Details.jsx | 83 | |
| 99 | { to: 'admins' }, | client/pages/admin/components/admins/Details.jsx | 83 | |
| 100 | 'Admins' | client/pages/admin/components/admins/Details.jsx | 83 | |
| 101 | ), | client/pages/admin/components/admins/Details.jsx | 83 | |
| 102 | ' / ', | client/pages/admin/components/admins/Details.jsx | 83 | |
| 103 | this.state.details.name.first, | client/pages/admin/components/admins/Details.jsx | 83 | |
| 104 | ' ', | client/pages/admin/components/admins/Details.jsx | 83 | |
| 105 | this.state.details.name.last | client/pages/admin/components/admins/Details.jsx | 83 | |
| 106 | ), | client/pages/admin/components/admins/Details.jsx | 83 | |
| 107 | React.createElement( | client/pages/admin/components/admins/Details.jsx | 84 | |
| 108 | 'div', | client/pages/admin/components/admins/Details.jsx | 85 | |
| 109 | { className: 'row' }, | client/pages/admin/components/admins/Details.jsx | 85 | |
| 110 | React.createElement( | client/pages/admin/components/admins/Details.jsx | 85 | |
| 111 | 'div', | client/pages/admin/components/admins/Details.jsx | 86 | |
| 112 | { className: 'col-sm-8' }, | client/pages/admin/components/admins/Details.jsx | 86 | |
| 113 | React.createElement(DetailsForm, { data: this.state.details }), | client/pages/admin/components/admins/Details.jsx | 86 | |
| 114 | React.createElement(UserForm, { | client/pages/admin/components/admins/Details.jsx | 87 | |
| 115 | details: this.state.details, | client/pages/admin/components/admins/Details.jsx | 89 | |
| 116 | data: this.state.user | client/pages/admin/components/admins/Details.jsx | 90 | |
| 117 | }), | client/pages/admin/components/admins/Details.jsx | 90 | |
| 118 | React.createElement(GroupsForm, { | client/pages/admin/components/admins/Details.jsx | 91 | |
| 119 | details: this.state.details, | client/pages/admin/components/admins/Details.jsx | 93 | |
| 120 | data: this.state.groups, | client/pages/admin/components/admins/Details.jsx | 94 | |
| 121 | list: this.state.adminGroups | client/pages/admin/components/admins/Details.jsx | 95 | |
| 122 | }), | client/pages/admin/components/admins/Details.jsx | 95 | |
| 123 | React.createElement(PermissionsForm, { | client/pages/admin/components/admins/Details.jsx | 96 | |
| 124 | details: this.state.details, | client/pages/admin/components/admins/Details.jsx | 98 | |
| 125 | data: this.state.permissions | client/pages/admin/components/admins/Details.jsx | 99 | |
| 126 | }), | client/pages/admin/components/admins/Details.jsx | 99 | |
| 127 | React.createElement(DeleteForm, { | client/pages/admin/components/admins/Details.jsx | 100 | |
| 128 | details: this.state.details, | client/pages/admin/components/admins/Details.jsx | 102 | |
| 129 | data: this.state['delete'] | client/pages/admin/components/admins/Details.jsx | 103 | |
| 130 | }) | client/pages/admin/components/admins/Details.jsx | 103 | |
| 131 | ) | client/pages/admin/components/admins/Details.jsx | 104 | |
| 132 | ) | client/pages/admin/components/admins/Details.jsx | 105 | |
| 133 | ); | client/pages/admin/components/admins/Details.jsx | 106 | |
| 134 | } | client/pages/admin/components/admins/Details.jsx | 108 | |
| 135 | }); | client/pages/admin/components/admins/Details.jsx | 109 | |
| 136 | client/pages/admin/components/admins/Details.jsx | 110 | ||
| 137 | 1 | module.exports = Component; | client/pages/admin/components/admins/Details.jsx | 113 |
| 138 | client/pages/admin/components/admins/Details.jsx | 113 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admins/DetailsForm.jsx | 1 | |
| 2 | client/pages/admin/components/admins/DetailsForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/DetailsForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admins/DetailsForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/admins/DetailsForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admins/DetailsForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admins/DetailsForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/DetailsForm.jsx | 6 |
| 9 | client/pages/admin/components/admins/DetailsForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/DetailsForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/admin/components/admins/DetailsForm.jsx | 9 | |
| 12 | client/pages/admin/components/admins/DetailsForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/admins/DetailsForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/DetailsForm.jsx | 11 | |
| 15 | client/pages/admin/components/admins/DetailsForm.jsx | 11 | ||
| 16 | 10 | return {}; | client/pages/admin/components/admins/DetailsForm.jsx | 13 |
| 17 | }, | client/pages/admin/components/admins/DetailsForm.jsx | 13 | |
| 18 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admins/DetailsForm.jsx | 15 | |
| 19 | client/pages/admin/components/admins/DetailsForm.jsx | 15 | ||
| 20 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/admins/DetailsForm.jsx | 17 |
| 21 | 5 | this.setState({ | client/pages/admin/components/admins/DetailsForm.jsx | 18 |
| 22 | hydrated: nextProps.data.hydrated, | client/pages/admin/components/admins/DetailsForm.jsx | 19 | |
| 23 | nameFirst: nextProps.data.name.first, | client/pages/admin/components/admins/DetailsForm.jsx | 20 | |
| 24 | nameMiddle: nextProps.data.name.middle, | client/pages/admin/components/admins/DetailsForm.jsx | 21 | |
| 25 | nameLast: nextProps.data.name.last | client/pages/admin/components/admins/DetailsForm.jsx | 22 | |
| 26 | }); | client/pages/admin/components/admins/DetailsForm.jsx | 22 | |
| 27 | } | client/pages/admin/components/admins/DetailsForm.jsx | 23 | |
| 28 | }, | client/pages/admin/components/admins/DetailsForm.jsx | 24 | |
| 29 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admins/DetailsForm.jsx | 26 | |
| 30 | client/pages/admin/components/admins/DetailsForm.jsx | 26 | ||
| 31 | 1 | event.preventDefault(); | client/pages/admin/components/admins/DetailsForm.jsx | 28 |
| 32 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/DetailsForm.jsx | 29 |
| 33 | client/pages/admin/components/admins/DetailsForm.jsx | 29 | ||
| 34 | 1 | Actions.saveDetails({ | client/pages/admin/components/admins/DetailsForm.jsx | 31 |
| 35 | id: this.props.data._id, | client/pages/admin/components/admins/DetailsForm.jsx | 32 | |
| 36 | nameFirst: this.state.nameFirst, | client/pages/admin/components/admins/DetailsForm.jsx | 33 | |
| 37 | nameMiddle: this.state.nameMiddle, | client/pages/admin/components/admins/DetailsForm.jsx | 34 | |
| 38 | nameLast: this.state.nameLast | client/pages/admin/components/admins/DetailsForm.jsx | 35 | |
| 39 | }); | client/pages/admin/components/admins/DetailsForm.jsx | 35 | |
| 40 | }, | client/pages/admin/components/admins/DetailsForm.jsx | 36 | |
| 41 | render: function render() { | client/pages/admin/components/admins/DetailsForm.jsx | 38 | |
| 42 | client/pages/admin/components/admins/DetailsForm.jsx | 38 | ||
| 43 | 16 | var alerts = []; | client/pages/admin/components/admins/DetailsForm.jsx | 40 |
| 44 | 16 | if (this.props.data.success) { | client/pages/admin/components/admins/DetailsForm.jsx | 41 |
| 45 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 42 |
| 46 | 'div', | client/pages/admin/components/admins/DetailsForm.jsx | 42 | |
| 47 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/admins/DetailsForm.jsx | 42 | |
| 48 | 'Success. Changes have been saved.' | client/pages/admin/components/admins/DetailsForm.jsx | 42 | |
| 49 | )); | client/pages/admin/components/admins/DetailsForm.jsx | 42 | |
| 50 | 15 | } else if (this.props.data.error) { | client/pages/admin/components/admins/DetailsForm.jsx | 44 |
| 51 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 47 |
| 52 | 'div', | client/pages/admin/components/admins/DetailsForm.jsx | 47 | |
| 53 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/admins/DetailsForm.jsx | 47 | |
| 54 | this.props.data.error | client/pages/admin/components/admins/DetailsForm.jsx | 47 | |
| 55 | )); | client/pages/admin/components/admins/DetailsForm.jsx | 48 | |
| 56 | } | client/pages/admin/components/admins/DetailsForm.jsx | 49 | |
| 57 | client/pages/admin/components/admins/DetailsForm.jsx | 50 | ||
| 58 | 16 | var notice; | client/pages/admin/components/admins/DetailsForm.jsx | 52 |
| 59 | 16 | if (!this.props.data.hydrated) { | client/pages/admin/components/admins/DetailsForm.jsx | 53 |
| 60 | 12 | notice = React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 54 |
| 61 | 'div', | client/pages/admin/components/admins/DetailsForm.jsx | 54 | |
| 62 | { className: 'alert alert-info' }, | client/pages/admin/components/admins/DetailsForm.jsx | 54 | |
| 63 | 'Loading data...' | client/pages/admin/components/admins/DetailsForm.jsx | 54 | |
| 64 | ); | client/pages/admin/components/admins/DetailsForm.jsx | 54 | |
| 65 | } | client/pages/admin/components/admins/DetailsForm.jsx | 56 | |
| 66 | client/pages/admin/components/admins/DetailsForm.jsx | 57 | ||
| 67 | 16 | var formElements; | client/pages/admin/components/admins/DetailsForm.jsx | 59 |
| 68 | 16 | if (this.props.data.hydrated) { | client/pages/admin/components/admins/DetailsForm.jsx | 60 |
| 69 | 4 | formElements = React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 61 |
| 70 | 'fieldset', | client/pages/admin/components/admins/DetailsForm.jsx | 61 | |
| 71 | null, | client/pages/admin/components/admins/DetailsForm.jsx | 61 | |
| 72 | React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 61 | |
| 73 | 'legend', | client/pages/admin/components/admins/DetailsForm.jsx | 62 | |
| 74 | null, | client/pages/admin/components/admins/DetailsForm.jsx | 62 | |
| 75 | 'Details' | client/pages/admin/components/admins/DetailsForm.jsx | 62 | |
| 76 | ), | client/pages/admin/components/admins/DetailsForm.jsx | 62 | |
| 77 | alerts, | client/pages/admin/components/admins/DetailsForm.jsx | 62 | |
| 78 | React.createElement(TextControl, { | client/pages/admin/components/admins/DetailsForm.jsx | 63 | |
| 79 | name: 'nameFirst', | client/pages/admin/components/admins/DetailsForm.jsx | 65 | |
| 80 | label: 'First name', | client/pages/admin/components/admins/DetailsForm.jsx | 66 | |
| 81 | hasError: this.props.data.hasError.nameFirst, | client/pages/admin/components/admins/DetailsForm.jsx | 67 | |
| 82 | valueLink: this.linkState('nameFirst'), | client/pages/admin/components/admins/DetailsForm.jsx | 68 | |
| 83 | help: this.props.data.help.nameFirst, | client/pages/admin/components/admins/DetailsForm.jsx | 69 | |
| 84 | disabled: this.props.data.loading | client/pages/admin/components/admins/DetailsForm.jsx | 70 | |
| 85 | }), | client/pages/admin/components/admins/DetailsForm.jsx | 70 | |
| 86 | React.createElement(TextControl, { | client/pages/admin/components/admins/DetailsForm.jsx | 71 | |
| 87 | name: 'nameMiddle', | client/pages/admin/components/admins/DetailsForm.jsx | 73 | |
| 88 | label: 'Middle name', | client/pages/admin/components/admins/DetailsForm.jsx | 74 | |
| 89 | hasError: this.props.data.hasError.nameMiddle, | client/pages/admin/components/admins/DetailsForm.jsx | 75 | |
| 90 | valueLink: this.linkState('nameMiddle'), | client/pages/admin/components/admins/DetailsForm.jsx | 76 | |
| 91 | help: this.props.data.help.nameMiddle, | client/pages/admin/components/admins/DetailsForm.jsx | 77 | |
| 92 | disabled: this.props.data.loading | client/pages/admin/components/admins/DetailsForm.jsx | 78 | |
| 93 | }), | client/pages/admin/components/admins/DetailsForm.jsx | 78 | |
| 94 | React.createElement(TextControl, { | client/pages/admin/components/admins/DetailsForm.jsx | 79 | |
| 95 | name: 'nameLast', | client/pages/admin/components/admins/DetailsForm.jsx | 81 | |
| 96 | label: 'Last name', | client/pages/admin/components/admins/DetailsForm.jsx | 82 | |
| 97 | hasError: this.props.data.hasError.nameLast, | client/pages/admin/components/admins/DetailsForm.jsx | 83 | |
| 98 | valueLink: this.linkState('nameLast'), | client/pages/admin/components/admins/DetailsForm.jsx | 84 | |
| 99 | help: this.props.data.help.nameLast, | client/pages/admin/components/admins/DetailsForm.jsx | 85 | |
| 100 | disabled: this.props.data.loading | client/pages/admin/components/admins/DetailsForm.jsx | 86 | |
| 101 | }), | client/pages/admin/components/admins/DetailsForm.jsx | 86 | |
| 102 | React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 87 | |
| 103 | ControlGroup, | client/pages/admin/components/admins/DetailsForm.jsx | 88 | |
| 104 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admins/DetailsForm.jsx | 88 | |
| 105 | React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 88 | |
| 106 | Button, | client/pages/admin/components/admins/DetailsForm.jsx | 89 | |
| 107 | { | client/pages/admin/components/admins/DetailsForm.jsx | 89 | |
| 108 | type: 'submit', | client/pages/admin/components/admins/DetailsForm.jsx | 90 | |
| 109 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/admins/DetailsForm.jsx | 91 | |
| 110 | disabled: this.props.data.loading }, | client/pages/admin/components/admins/DetailsForm.jsx | 92 | |
| 111 | 'Save changes', | client/pages/admin/components/admins/DetailsForm.jsx | 92 | |
| 112 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admins/DetailsForm.jsx | 92 | |
| 113 | ) | client/pages/admin/components/admins/DetailsForm.jsx | 95 | |
| 114 | ) | client/pages/admin/components/admins/DetailsForm.jsx | 96 | |
| 115 | ); | client/pages/admin/components/admins/DetailsForm.jsx | 97 | |
| 116 | } | client/pages/admin/components/admins/DetailsForm.jsx | 98 | |
| 117 | client/pages/admin/components/admins/DetailsForm.jsx | 99 | ||
| 118 | 16 | return React.createElement( | client/pages/admin/components/admins/DetailsForm.jsx | 101 |
| 119 | 'form', | client/pages/admin/components/admins/DetailsForm.jsx | 102 | |
| 120 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admins/DetailsForm.jsx | 102 | |
| 121 | notice, | client/pages/admin/components/admins/DetailsForm.jsx | 102 | |
| 122 | formElements | client/pages/admin/components/admins/DetailsForm.jsx | 103 | |
| 123 | ); | client/pages/admin/components/admins/DetailsForm.jsx | 104 | |
| 124 | } | client/pages/admin/components/admins/DetailsForm.jsx | 106 | |
| 125 | }); | client/pages/admin/components/admins/DetailsForm.jsx | 107 | |
| 126 | client/pages/admin/components/admins/DetailsForm.jsx | 108 | ||
| 127 | 1 | module.exports = Component; | client/pages/admin/components/admins/DetailsForm.jsx | 111 |
| 128 | client/pages/admin/components/admins/DetailsForm.jsx | 111 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admins/FilterForm.jsx | 1 | |
| 2 | client/pages/admin/components/admins/FilterForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/FilterForm.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/pages/admin/components/admins/FilterForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/admins/FilterForm.jsx | 3 |
| 6 | 1 | var SelectControl = require('../../../../components/form/SelectControl'); | client/pages/admin/components/admins/FilterForm.jsx | 4 |
| 7 | client/pages/admin/components/admins/FilterForm.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/FilterForm.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/admins/FilterForm.jsx | 7 | |
| 10 | client/pages/admin/components/admins/FilterForm.jsx | 7 | ||
| 11 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/admins/FilterForm.jsx | 8 | |
| 12 | defaultState: { | client/pages/admin/components/admins/FilterForm.jsx | 9 | |
| 13 | username: '', | client/pages/admin/components/admins/FilterForm.jsx | 10 | |
| 14 | sort: '_id', | client/pages/admin/components/admins/FilterForm.jsx | 11 | |
| 15 | limit: 20, | client/pages/admin/components/admins/FilterForm.jsx | 12 | |
| 16 | page: 1 | client/pages/admin/components/admins/FilterForm.jsx | 13 | |
| 17 | }, | client/pages/admin/components/admins/FilterForm.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/FilterForm.jsx | 15 | |
| 19 | client/pages/admin/components/admins/FilterForm.jsx | 15 | ||
| 20 | 14 | return ObjectAssign({}, this.defaultState, this.props.query); | client/pages/admin/components/admins/FilterForm.jsx | 17 |
| 21 | }, | client/pages/admin/components/admins/FilterForm.jsx | 17 | |
| 22 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admins/FilterForm.jsx | 19 | |
| 23 | client/pages/admin/components/admins/FilterForm.jsx | 19 | ||
| 24 | 6 | var nextState = ObjectAssign({}, this.defaultState, nextProps.query); | client/pages/admin/components/admins/FilterForm.jsx | 21 |
| 25 | 6 | this.setState(nextState); | client/pages/admin/components/admins/FilterForm.jsx | 22 |
| 26 | }, | client/pages/admin/components/admins/FilterForm.jsx | 22 | |
| 27 | onMenuChange: function onMenuChange(event) { | client/pages/admin/components/admins/FilterForm.jsx | 24 | |
| 28 | client/pages/admin/components/admins/FilterForm.jsx | 24 | ||
| 29 | 2 | var newState = { page: 1 }; | client/pages/admin/components/admins/FilterForm.jsx | 26 |
| 30 | 2 | newState[event.target.name] = event.target.value; | client/pages/admin/components/admins/FilterForm.jsx | 27 |
| 31 | 2 | this.setState(newState, this.props.onChange); | client/pages/admin/components/admins/FilterForm.jsx | 28 |
| 32 | }, | client/pages/admin/components/admins/FilterForm.jsx | 28 | |
| 33 | onEnterSubmit: function onEnterSubmit(event) { | client/pages/admin/components/admins/FilterForm.jsx | 30 | |
| 34 | client/pages/admin/components/admins/FilterForm.jsx | 30 | ||
| 35 | 2 | if (event.which === 13) { | client/pages/admin/components/admins/FilterForm.jsx | 32 |
| 36 | 1 | event.preventDefault(); | client/pages/admin/components/admins/FilterForm.jsx | 33 |
| 37 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/FilterForm.jsx | 34 |
| 38 | 1 | this.setState({ page: 1 }, this.props.onChange); | client/pages/admin/components/admins/FilterForm.jsx | 35 |
| 39 | } | client/pages/admin/components/admins/FilterForm.jsx | 35 | |
| 40 | }, | client/pages/admin/components/admins/FilterForm.jsx | 36 | |
| 41 | changePage: function changePage(page) { | client/pages/admin/components/admins/FilterForm.jsx | 38 | |
| 42 | client/pages/admin/components/admins/FilterForm.jsx | 38 | ||
| 43 | 2 | this.setState({ page: page }, this.props.onChange); | client/pages/admin/components/admins/FilterForm.jsx | 40 |
| 44 | }, | client/pages/admin/components/admins/FilterForm.jsx | 40 | |
| 45 | render: function render() { | client/pages/admin/components/admins/FilterForm.jsx | 42 | |
| 46 | client/pages/admin/components/admins/FilterForm.jsx | 42 | ||
| 47 | 25 | return React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 44 |
| 48 | 'form', | client/pages/admin/components/admins/FilterForm.jsx | 45 | |
| 49 | { onKeyDown: this.onEnterSubmit, onSubmit: this.props.onChange }, | client/pages/admin/components/admins/FilterForm.jsx | 45 | |
| 50 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 45 | |
| 51 | 'div', | client/pages/admin/components/admins/FilterForm.jsx | 46 | |
| 52 | { className: 'row' }, | client/pages/admin/components/admins/FilterForm.jsx | 46 | |
| 53 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 46 | |
| 54 | 'div', | client/pages/admin/components/admins/FilterForm.jsx | 47 | |
| 55 | { className: 'col-sm-4' }, | client/pages/admin/components/admins/FilterForm.jsx | 47 | |
| 56 | React.createElement(TextControl, { | client/pages/admin/components/admins/FilterForm.jsx | 47 | |
| 57 | name: 'username', | client/pages/admin/components/admins/FilterForm.jsx | 49 | |
| 58 | label: 'Username search', | client/pages/admin/components/admins/FilterForm.jsx | 50 | |
| 59 | valueLink: this.linkState('username'), | client/pages/admin/components/admins/FilterForm.jsx | 51 | |
| 60 | disabled: this.props.loading | client/pages/admin/components/admins/FilterForm.jsx | 52 | |
| 61 | }) | client/pages/admin/components/admins/FilterForm.jsx | 52 | |
| 62 | ), | client/pages/admin/components/admins/FilterForm.jsx | 53 | |
| 63 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 54 | |
| 64 | 'div', | client/pages/admin/components/admins/FilterForm.jsx | 55 | |
| 65 | { className: 'col-sm-4' }, | client/pages/admin/components/admins/FilterForm.jsx | 55 | |
| 66 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 55 | |
| 67 | SelectControl, | client/pages/admin/components/admins/FilterForm.jsx | 56 | |
| 68 | { | client/pages/admin/components/admins/FilterForm.jsx | 56 | |
| 69 | name: 'sort', | client/pages/admin/components/admins/FilterForm.jsx | 57 | |
| 70 | label: 'Sort by', | client/pages/admin/components/admins/FilterForm.jsx | 58 | |
| 71 | disabled: this.props.loading, | client/pages/admin/components/admins/FilterForm.jsx | 59 | |
| 72 | onChange: this.onMenuChange, | client/pages/admin/components/admins/FilterForm.jsx | 60 | |
| 73 | value: this.state.sort }, | client/pages/admin/components/admins/FilterForm.jsx | 61 | |
| 74 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 61 | |
| 75 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 63 | |
| 76 | { value: '_id' }, | client/pages/admin/components/admins/FilterForm.jsx | 63 | |
| 77 | 'id â–²' | client/pages/admin/components/admins/FilterForm.jsx | 63 | |
| 78 | ), | client/pages/admin/components/admins/FilterForm.jsx | 63 | |
| 79 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 63 | |
| 80 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 64 | |
| 81 | { value: '-_id' }, | client/pages/admin/components/admins/FilterForm.jsx | 64 | |
| 82 | 'id â–¼' | client/pages/admin/components/admins/FilterForm.jsx | 64 | |
| 83 | ), | client/pages/admin/components/admins/FilterForm.jsx | 64 | |
| 84 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 64 | |
| 85 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 65 | |
| 86 | { value: 'username' }, | client/pages/admin/components/admins/FilterForm.jsx | 65 | |
| 87 | 'username â–²' | client/pages/admin/components/admins/FilterForm.jsx | 65 | |
| 88 | ), | client/pages/admin/components/admins/FilterForm.jsx | 65 | |
| 89 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 65 | |
| 90 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 66 | |
| 91 | { value: '-username' }, | client/pages/admin/components/admins/FilterForm.jsx | 66 | |
| 92 | 'username â–¼' | client/pages/admin/components/admins/FilterForm.jsx | 66 | |
| 93 | ) | client/pages/admin/components/admins/FilterForm.jsx | 66 | |
| 94 | ) | client/pages/admin/components/admins/FilterForm.jsx | 66 | |
| 95 | ), | client/pages/admin/components/admins/FilterForm.jsx | 67 | |
| 96 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 68 | |
| 97 | 'div', | client/pages/admin/components/admins/FilterForm.jsx | 69 | |
| 98 | { className: 'col-sm-4' }, | client/pages/admin/components/admins/FilterForm.jsx | 69 | |
| 99 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 69 | |
| 100 | SelectControl, | client/pages/admin/components/admins/FilterForm.jsx | 70 | |
| 101 | { | client/pages/admin/components/admins/FilterForm.jsx | 70 | |
| 102 | name: 'limit', | client/pages/admin/components/admins/FilterForm.jsx | 71 | |
| 103 | label: 'Limit', | client/pages/admin/components/admins/FilterForm.jsx | 72 | |
| 104 | disabled: this.props.loading, | client/pages/admin/components/admins/FilterForm.jsx | 73 | |
| 105 | onChange: this.onMenuChange, | client/pages/admin/components/admins/FilterForm.jsx | 74 | |
| 106 | value: this.state.limit }, | client/pages/admin/components/admins/FilterForm.jsx | 75 | |
| 107 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 75 | |
| 108 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 77 | |
| 109 | { value: 10 }, | client/pages/admin/components/admins/FilterForm.jsx | 77 | |
| 110 | '10 items' | client/pages/admin/components/admins/FilterForm.jsx | 77 | |
| 111 | ), | client/pages/admin/components/admins/FilterForm.jsx | 77 | |
| 112 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 77 | |
| 113 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 78 | |
| 114 | { value: 20 }, | client/pages/admin/components/admins/FilterForm.jsx | 78 | |
| 115 | '20 items' | client/pages/admin/components/admins/FilterForm.jsx | 78 | |
| 116 | ), | client/pages/admin/components/admins/FilterForm.jsx | 78 | |
| 117 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 78 | |
| 118 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 79 | |
| 119 | { value: 50 }, | client/pages/admin/components/admins/FilterForm.jsx | 79 | |
| 120 | '50 items' | client/pages/admin/components/admins/FilterForm.jsx | 79 | |
| 121 | ), | client/pages/admin/components/admins/FilterForm.jsx | 79 | |
| 122 | React.createElement( | client/pages/admin/components/admins/FilterForm.jsx | 79 | |
| 123 | 'option', | client/pages/admin/components/admins/FilterForm.jsx | 80 | |
| 124 | { value: 100 }, | client/pages/admin/components/admins/FilterForm.jsx | 80 | |
| 125 | '100 items' | client/pages/admin/components/admins/FilterForm.jsx | 80 | |
| 126 | ) | client/pages/admin/components/admins/FilterForm.jsx | 80 | |
| 127 | ) | client/pages/admin/components/admins/FilterForm.jsx | 80 | |
| 128 | ) | client/pages/admin/components/admins/FilterForm.jsx | 81 | |
| 129 | ) | client/pages/admin/components/admins/FilterForm.jsx | 82 | |
| 130 | ); | client/pages/admin/components/admins/FilterForm.jsx | 83 | |
| 131 | } | client/pages/admin/components/admins/FilterForm.jsx | 85 | |
| 132 | }); | client/pages/admin/components/admins/FilterForm.jsx | 86 | |
| 133 | client/pages/admin/components/admins/FilterForm.jsx | 87 | ||
| 134 | 1 | module.exports = Component; | client/pages/admin/components/admins/FilterForm.jsx | 90 |
| 135 | client/pages/admin/components/admins/FilterForm.jsx | 90 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admins/GroupsForm.jsx | 1 | |
| 2 | client/pages/admin/components/admins/GroupsForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/GroupsForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admins/GroupsForm.jsx | 2 |
| 5 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admins/GroupsForm.jsx | 3 |
| 6 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admins/GroupsForm.jsx | 4 |
| 7 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/GroupsForm.jsx | 5 |
| 8 | client/pages/admin/components/admins/GroupsForm.jsx | 5 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/GroupsForm.jsx | 8 |
| 10 | displayName: 'Component', | client/pages/admin/components/admins/GroupsForm.jsx | 8 | |
| 11 | client/pages/admin/components/admins/GroupsForm.jsx | 8 | ||
| 12 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/admins/GroupsForm.jsx | 9 | |
| 13 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/GroupsForm.jsx | 10 | |
| 14 | client/pages/admin/components/admins/GroupsForm.jsx | 10 | ||
| 15 | 14 | return {}; | client/pages/admin/components/admins/GroupsForm.jsx | 12 |
| 16 | }, | client/pages/admin/components/admins/GroupsForm.jsx | 12 | |
| 17 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admins/GroupsForm.jsx | 14 | |
| 18 | client/pages/admin/components/admins/GroupsForm.jsx | 14 | ||
| 19 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/admins/GroupsForm.jsx | 16 |
| 20 | 5 | this.setState({ | client/pages/admin/components/admins/GroupsForm.jsx | 17 |
| 21 | hydrated: nextProps.details.hydrated, | client/pages/admin/components/admins/GroupsForm.jsx | 18 | |
| 22 | groups: nextProps.details.groups | client/pages/admin/components/admins/GroupsForm.jsx | 19 | |
| 23 | }); | client/pages/admin/components/admins/GroupsForm.jsx | 19 | |
| 24 | } | client/pages/admin/components/admins/GroupsForm.jsx | 20 | |
| 25 | }, | client/pages/admin/components/admins/GroupsForm.jsx | 21 | |
| 26 | handleNewGroup: function handleNewGroup(event) { | client/pages/admin/components/admins/GroupsForm.jsx | 23 | |
| 27 | client/pages/admin/components/admins/GroupsForm.jsx | 23 | ||
| 28 | 7 | var newGroup = this.state.newGroup; | client/pages/admin/components/admins/GroupsForm.jsx | 25 |
| 29 | client/pages/admin/components/admins/GroupsForm.jsx | 25 | ||
| 30 | 7 | if (!newGroup) { | client/pages/admin/components/admins/GroupsForm.jsx | 27 |
| 31 | 2 | return; | client/pages/admin/components/admins/GroupsForm.jsx | 28 |
| 32 | } | client/pages/admin/components/admins/GroupsForm.jsx | 28 | |
| 33 | client/pages/admin/components/admins/GroupsForm.jsx | 29 | ||
| 34 | 5 | var newGroupValue; | client/pages/admin/components/admins/GroupsForm.jsx | 31 |
| 35 | 5 | this.props.list.data.forEach(function (group) { | client/pages/admin/components/admins/GroupsForm.jsx | 32 |
| 36 | client/pages/admin/components/admins/GroupsForm.jsx | 32 | ||
| 37 | 15 | if (group._id === newGroup) { | client/pages/admin/components/admins/GroupsForm.jsx | 34 |
| 38 | 5 | newGroupValue = group.name; | client/pages/admin/components/admins/GroupsForm.jsx | 35 |
| 39 | } | client/pages/admin/components/admins/GroupsForm.jsx | 35 | |
| 40 | }); | client/pages/admin/components/admins/GroupsForm.jsx | 36 | |
| 41 | client/pages/admin/components/admins/GroupsForm.jsx | 37 | ||
| 42 | 5 | var nextGroups = this.state.groups || {}; | client/pages/admin/components/admins/GroupsForm.jsx | 39 |
| 43 | 5 | if (nextGroups.hasOwnProperty(newGroup)) { | client/pages/admin/components/admins/GroupsForm.jsx | 40 |
| 44 | 1 | this.setState({ error: 'That group already exists.' }); | client/pages/admin/components/admins/GroupsForm.jsx | 41 |
| 45 | 1 | setTimeout((function () { | client/pages/admin/components/admins/GroupsForm.jsx | 42 |
| 46 | client/pages/admin/components/admins/GroupsForm.jsx | 42 | ||
| 47 | 1 | this.setState({ error: undefined }); | client/pages/admin/components/admins/GroupsForm.jsx | 44 |
| 48 | }).bind(this), 2500); | client/pages/admin/components/admins/GroupsForm.jsx | 44 | |
| 49 | } else { | client/pages/admin/components/admins/GroupsForm.jsx | 45 | |
| 50 | 4 | nextGroups[newGroup] = newGroupValue; | client/pages/admin/components/admins/GroupsForm.jsx | 48 |
| 51 | 4 | this.setState({ groups: nextGroups }); | client/pages/admin/components/admins/GroupsForm.jsx | 49 |
| 52 | } | client/pages/admin/components/admins/GroupsForm.jsx | 49 | |
| 53 | client/pages/admin/components/admins/GroupsForm.jsx | 50 | ||
| 54 | 5 | this.setState({ newGroup: '' }); | client/pages/admin/components/admins/GroupsForm.jsx | 52 |
| 55 | }, | client/pages/admin/components/admins/GroupsForm.jsx | 52 | |
| 56 | handleDeleteGroup: function handleDeleteGroup(key, event) { | client/pages/admin/components/admins/GroupsForm.jsx | 54 | |
| 57 | client/pages/admin/components/admins/GroupsForm.jsx | 54 | ||
| 58 | 1 | var nextGroups = this.state.groups; | client/pages/admin/components/admins/GroupsForm.jsx | 56 |
| 59 | 1 | delete nextGroups[key]; | client/pages/admin/components/admins/GroupsForm.jsx | 57 |
| 60 | 1 | this.setState({ groups: nextGroups }); | client/pages/admin/components/admins/GroupsForm.jsx | 58 |
| 61 | }, | client/pages/admin/components/admins/GroupsForm.jsx | 58 | |
| 62 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admins/GroupsForm.jsx | 60 | |
| 63 | client/pages/admin/components/admins/GroupsForm.jsx | 60 | ||
| 64 | 1 | event.preventDefault(); | client/pages/admin/components/admins/GroupsForm.jsx | 62 |
| 65 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/GroupsForm.jsx | 63 |
| 66 | client/pages/admin/components/admins/GroupsForm.jsx | 63 | ||
| 67 | 1 | Actions.saveGroups({ | client/pages/admin/components/admins/GroupsForm.jsx | 65 |
| 68 | id: this.props.details._id, | client/pages/admin/components/admins/GroupsForm.jsx | 66 | |
| 69 | groups: this.state.groups | client/pages/admin/components/admins/GroupsForm.jsx | 67 | |
| 70 | }); | client/pages/admin/components/admins/GroupsForm.jsx | 67 | |
| 71 | }, | client/pages/admin/components/admins/GroupsForm.jsx | 68 | |
| 72 | render: function render() { | client/pages/admin/components/admins/GroupsForm.jsx | 70 | |
| 73 | client/pages/admin/components/admins/GroupsForm.jsx | 70 | ||
| 74 | 31 | var alerts = []; | client/pages/admin/components/admins/GroupsForm.jsx | 72 |
| 75 | 31 | var error = this.props.data.error || this.state.error; | client/pages/admin/components/admins/GroupsForm.jsx | 73 |
| 76 | 31 | if (this.props.data.success) { | client/pages/admin/components/admins/GroupsForm.jsx | 74 |
| 77 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 75 |
| 78 | 'div', | client/pages/admin/components/admins/GroupsForm.jsx | 75 | |
| 79 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/admins/GroupsForm.jsx | 75 | |
| 80 | 'Success. Changes have been saved.' | client/pages/admin/components/admins/GroupsForm.jsx | 75 | |
| 81 | )); | client/pages/admin/components/admins/GroupsForm.jsx | 75 | |
| 82 | 30 | } else if (error) { | client/pages/admin/components/admins/GroupsForm.jsx | 77 |
| 83 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 80 |
| 84 | 'div', | client/pages/admin/components/admins/GroupsForm.jsx | 80 | |
| 85 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/admins/GroupsForm.jsx | 80 | |
| 86 | error | client/pages/admin/components/admins/GroupsForm.jsx | 80 | |
| 87 | )); | client/pages/admin/components/admins/GroupsForm.jsx | 81 | |
| 88 | } | client/pages/admin/components/admins/GroupsForm.jsx | 82 | |
| 89 | client/pages/admin/components/admins/GroupsForm.jsx | 83 | ||
| 90 | 31 | var notice; | client/pages/admin/components/admins/GroupsForm.jsx | 85 |
| 91 | 31 | if (!this.props.details.hydrated) { | client/pages/admin/components/admins/GroupsForm.jsx | 86 |
| 92 | 12 | notice = React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 87 |
| 93 | 'div', | client/pages/admin/components/admins/GroupsForm.jsx | 87 | |
| 94 | { className: 'alert alert-info' }, | client/pages/admin/components/admins/GroupsForm.jsx | 87 | |
| 95 | 'Loading data...' | client/pages/admin/components/admins/GroupsForm.jsx | 87 | |
| 96 | ); | client/pages/admin/components/admins/GroupsForm.jsx | 87 | |
| 97 | } | client/pages/admin/components/admins/GroupsForm.jsx | 89 | |
| 98 | client/pages/admin/components/admins/GroupsForm.jsx | 90 | ||
| 99 | 31 | var formElements; | client/pages/admin/components/admins/GroupsForm.jsx | 92 |
| 100 | 31 | if (this.props.details.hydrated) { | client/pages/admin/components/admins/GroupsForm.jsx | 93 |
| 101 | 19 | var groups = this.state.groups || {}; | client/pages/admin/components/admins/GroupsForm.jsx | 94 |
| 102 | 19 | var groupKeys = Object.keys(groups).sort(function (a, b) { | client/pages/admin/components/admins/GroupsForm.jsx | 95 |
| 103 | client/pages/admin/components/admins/GroupsForm.jsx | 95 | ||
| 104 | 14 | return a.toLowerCase().localeCompare(b.toLowerCase()); | client/pages/admin/components/admins/GroupsForm.jsx | 97 |
| 105 | }); | client/pages/admin/components/admins/GroupsForm.jsx | 97 | |
| 106 | 19 | var groupsUi = groupKeys.map((function (key) { | client/pages/admin/components/admins/GroupsForm.jsx | 99 |
| 107 | client/pages/admin/components/admins/GroupsForm.jsx | 99 | ||
| 108 | 26 | var deleteHandler = this.handleDeleteGroup.bind(this, key); | client/pages/admin/components/admins/GroupsForm.jsx | 101 |
| 109 | client/pages/admin/components/admins/GroupsForm.jsx | 101 | ||
| 110 | 26 | return React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 103 |
| 111 | 'div', | client/pages/admin/components/admins/GroupsForm.jsx | 104 | |
| 112 | { | client/pages/admin/components/admins/GroupsForm.jsx | 104 | |
| 113 | key: key, | client/pages/admin/components/admins/GroupsForm.jsx | 105 | |
| 114 | className: 'input-group' }, | client/pages/admin/components/admins/GroupsForm.jsx | 106 | |
| 115 | React.createElement('input', { | client/pages/admin/components/admins/GroupsForm.jsx | 106 | |
| 116 | type: 'text', | client/pages/admin/components/admins/GroupsForm.jsx | 109 | |
| 117 | className: 'form-control', | client/pages/admin/components/admins/GroupsForm.jsx | 110 | |
| 118 | disabled: true, | client/pages/admin/components/admins/GroupsForm.jsx | 111 | |
| 119 | value: groups[key] | client/pages/admin/components/admins/GroupsForm.jsx | 112 | |
| 120 | }), | client/pages/admin/components/admins/GroupsForm.jsx | 112 | |
| 121 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 113 | |
| 122 | 'span', | client/pages/admin/components/admins/GroupsForm.jsx | 114 | |
| 123 | { className: 'input-group-btn' }, | client/pages/admin/components/admins/GroupsForm.jsx | 114 | |
| 124 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 114 | |
| 125 | 'button', | client/pages/admin/components/admins/GroupsForm.jsx | 115 | |
| 126 | { | client/pages/admin/components/admins/GroupsForm.jsx | 115 | |
| 127 | type: 'button', | client/pages/admin/components/admins/GroupsForm.jsx | 116 | |
| 128 | className: 'btn btn-warning', | client/pages/admin/components/admins/GroupsForm.jsx | 117 | |
| 129 | onClick: deleteHandler }, | client/pages/admin/components/admins/GroupsForm.jsx | 118 | |
| 130 | 'Remove' | client/pages/admin/components/admins/GroupsForm.jsx | 118 | |
| 131 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 118 | |
| 132 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 121 | |
| 133 | ); | client/pages/admin/components/admins/GroupsForm.jsx | 122 | |
| 134 | }).bind(this)); | client/pages/admin/components/admins/GroupsForm.jsx | 124 | |
| 135 | client/pages/admin/components/admins/GroupsForm.jsx | 125 | ||
| 136 | 19 | if (groupKeys.length === 0) { | client/pages/admin/components/admins/GroupsForm.jsx | 127 |
| 137 | 6 | groupsUi = React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 128 |
| 138 | 'div', | client/pages/admin/components/admins/GroupsForm.jsx | 128 | |
| 139 | null, | client/pages/admin/components/admins/GroupsForm.jsx | 128 | |
| 140 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 128 | |
| 141 | 'span', | client/pages/admin/components/admins/GroupsForm.jsx | 129 | |
| 142 | { className: 'label label-default' }, | client/pages/admin/components/admins/GroupsForm.jsx | 129 | |
| 143 | 'empty list' | client/pages/admin/components/admins/GroupsForm.jsx | 129 | |
| 144 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 129 | |
| 145 | ); | client/pages/admin/components/admins/GroupsForm.jsx | 131 | |
| 146 | } | client/pages/admin/components/admins/GroupsForm.jsx | 132 | |
| 147 | client/pages/admin/components/admins/GroupsForm.jsx | 133 | ||
| 148 | 19 | var adminGroups = this.props.list.data; | client/pages/admin/components/admins/GroupsForm.jsx | 135 |
| 149 | 19 | var groupOptions = adminGroups.map(function (group) { | client/pages/admin/components/admins/GroupsForm.jsx | 136 |
| 150 | client/pages/admin/components/admins/GroupsForm.jsx | 136 | ||
| 151 | 57 | return React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 138 |
| 152 | 'option', | client/pages/admin/components/admins/GroupsForm.jsx | 139 | |
| 153 | { key: group._id, value: group._id }, | client/pages/admin/components/admins/GroupsForm.jsx | 139 | |
| 154 | group.name | client/pages/admin/components/admins/GroupsForm.jsx | 139 | |
| 155 | ); | client/pages/admin/components/admins/GroupsForm.jsx | 140 | |
| 156 | }); | client/pages/admin/components/admins/GroupsForm.jsx | 142 | |
| 157 | client/pages/admin/components/admins/GroupsForm.jsx | 143 | ||
| 158 | 19 | formElements = React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 145 |
| 159 | 'fieldset', | client/pages/admin/components/admins/GroupsForm.jsx | 145 | |
| 160 | null, | client/pages/admin/components/admins/GroupsForm.jsx | 145 | |
| 161 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 145 | |
| 162 | 'legend', | client/pages/admin/components/admins/GroupsForm.jsx | 146 | |
| 163 | null, | client/pages/admin/components/admins/GroupsForm.jsx | 146 | |
| 164 | 'Groups' | client/pages/admin/components/admins/GroupsForm.jsx | 146 | |
| 165 | ), | client/pages/admin/components/admins/GroupsForm.jsx | 146 | |
| 166 | alerts, | client/pages/admin/components/admins/GroupsForm.jsx | 146 | |
| 167 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 147 | |
| 168 | ControlGroup, | client/pages/admin/components/admins/GroupsForm.jsx | 148 | |
| 169 | { label: 'Add group', hideHelp: true }, | client/pages/admin/components/admins/GroupsForm.jsx | 148 | |
| 170 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 148 | |
| 171 | 'div', | client/pages/admin/components/admins/GroupsForm.jsx | 149 | |
| 172 | { className: 'input-group' }, | client/pages/admin/components/admins/GroupsForm.jsx | 149 | |
| 173 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 149 | |
| 174 | 'select', | client/pages/admin/components/admins/GroupsForm.jsx | 150 | |
| 175 | { | client/pages/admin/components/admins/GroupsForm.jsx | 150 | |
| 176 | ref: 'newGroup', | client/pages/admin/components/admins/GroupsForm.jsx | 151 | |
| 177 | name: 'newGroup', | client/pages/admin/components/admins/GroupsForm.jsx | 152 | |
| 178 | className: 'form-control', | client/pages/admin/components/admins/GroupsForm.jsx | 153 | |
| 179 | valueLink: this.linkState('newGroup') }, | client/pages/admin/components/admins/GroupsForm.jsx | 154 | |
| 180 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 154 | |
| 181 | 'option', | client/pages/admin/components/admins/GroupsForm.jsx | 156 | |
| 182 | { value: '' }, | client/pages/admin/components/admins/GroupsForm.jsx | 156 | |
| 183 | '--- select ---' | client/pages/admin/components/admins/GroupsForm.jsx | 156 | |
| 184 | ), | client/pages/admin/components/admins/GroupsForm.jsx | 156 | |
| 185 | groupOptions | client/pages/admin/components/admins/GroupsForm.jsx | 156 | |
| 186 | ), | client/pages/admin/components/admins/GroupsForm.jsx | 157 | |
| 187 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 158 | |
| 188 | 'span', | client/pages/admin/components/admins/GroupsForm.jsx | 159 | |
| 189 | { className: 'input-group-btn' }, | client/pages/admin/components/admins/GroupsForm.jsx | 159 | |
| 190 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 159 | |
| 191 | 'button', | client/pages/admin/components/admins/GroupsForm.jsx | 160 | |
| 192 | { | client/pages/admin/components/admins/GroupsForm.jsx | 160 | |
| 193 | ref: 'newGroupButton', | client/pages/admin/components/admins/GroupsForm.jsx | 161 | |
| 194 | type: 'button', | client/pages/admin/components/admins/GroupsForm.jsx | 162 | |
| 195 | className: 'btn btn-default', | client/pages/admin/components/admins/GroupsForm.jsx | 163 | |
| 196 | onClick: this.handleNewGroup }, | client/pages/admin/components/admins/GroupsForm.jsx | 164 | |
| 197 | 'Add' | client/pages/admin/components/admins/GroupsForm.jsx | 164 | |
| 198 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 164 | |
| 199 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 167 | |
| 200 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 168 | |
| 201 | ), | client/pages/admin/components/admins/GroupsForm.jsx | 169 | |
| 202 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 170 | |
| 203 | ControlGroup, | client/pages/admin/components/admins/GroupsForm.jsx | 171 | |
| 204 | { | client/pages/admin/components/admins/GroupsForm.jsx | 171 | |
| 205 | ref: 'groupContainer', | client/pages/admin/components/admins/GroupsForm.jsx | 172 | |
| 206 | label: 'Existing groups', | client/pages/admin/components/admins/GroupsForm.jsx | 173 | |
| 207 | hideHelp: true }, | client/pages/admin/components/admins/GroupsForm.jsx | 174 | |
| 208 | groupsUi | client/pages/admin/components/admins/GroupsForm.jsx | 174 | |
| 209 | ), | client/pages/admin/components/admins/GroupsForm.jsx | 176 | |
| 210 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 177 | |
| 211 | ControlGroup, | client/pages/admin/components/admins/GroupsForm.jsx | 178 | |
| 212 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admins/GroupsForm.jsx | 178 | |
| 213 | React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 178 | |
| 214 | Button, | client/pages/admin/components/admins/GroupsForm.jsx | 179 | |
| 215 | { | client/pages/admin/components/admins/GroupsForm.jsx | 179 | |
| 216 | type: 'submit', | client/pages/admin/components/admins/GroupsForm.jsx | 180 | |
| 217 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/admins/GroupsForm.jsx | 181 | |
| 218 | disabled: this.props.data.loading }, | client/pages/admin/components/admins/GroupsForm.jsx | 182 | |
| 219 | 'Save changes', | client/pages/admin/components/admins/GroupsForm.jsx | 182 | |
| 220 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admins/GroupsForm.jsx | 182 | |
| 221 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 185 | |
| 222 | ) | client/pages/admin/components/admins/GroupsForm.jsx | 186 | |
| 223 | ); | client/pages/admin/components/admins/GroupsForm.jsx | 187 | |
| 224 | } | client/pages/admin/components/admins/GroupsForm.jsx | 188 | |
| 225 | client/pages/admin/components/admins/GroupsForm.jsx | 189 | ||
| 226 | 31 | return React.createElement( | client/pages/admin/components/admins/GroupsForm.jsx | 191 |
| 227 | 'form', | client/pages/admin/components/admins/GroupsForm.jsx | 192 | |
| 228 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admins/GroupsForm.jsx | 192 | |
| 229 | notice, | client/pages/admin/components/admins/GroupsForm.jsx | 192 | |
| 230 | formElements | client/pages/admin/components/admins/GroupsForm.jsx | 193 | |
| 231 | ); | client/pages/admin/components/admins/GroupsForm.jsx | 194 | |
| 232 | } | client/pages/admin/components/admins/GroupsForm.jsx | 196 | |
| 233 | }); | client/pages/admin/components/admins/GroupsForm.jsx | 197 | |
| 234 | client/pages/admin/components/admins/GroupsForm.jsx | 198 | ||
| 235 | 1 | module.exports = Component; | client/pages/admin/components/admins/GroupsForm.jsx | 201 |
| 236 | client/pages/admin/components/admins/GroupsForm.jsx | 201 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admins/PermissionsForm.jsx | 1 | |
| 2 | client/pages/admin/components/admins/PermissionsForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/PermissionsForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admins/PermissionsForm.jsx | 2 |
| 5 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admins/PermissionsForm.jsx | 3 |
| 6 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admins/PermissionsForm.jsx | 4 |
| 7 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/PermissionsForm.jsx | 5 |
| 8 | client/pages/admin/components/admins/PermissionsForm.jsx | 5 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/PermissionsForm.jsx | 8 |
| 10 | displayName: 'Component', | client/pages/admin/components/admins/PermissionsForm.jsx | 8 | |
| 11 | client/pages/admin/components/admins/PermissionsForm.jsx | 8 | ||
| 12 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/admins/PermissionsForm.jsx | 9 | |
| 13 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/PermissionsForm.jsx | 10 | |
| 14 | client/pages/admin/components/admins/PermissionsForm.jsx | 10 | ||
| 15 | 15 | return {}; | client/pages/admin/components/admins/PermissionsForm.jsx | 12 |
| 16 | }, | client/pages/admin/components/admins/PermissionsForm.jsx | 12 | |
| 17 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admins/PermissionsForm.jsx | 14 | |
| 18 | client/pages/admin/components/admins/PermissionsForm.jsx | 14 | ||
| 19 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/admins/PermissionsForm.jsx | 16 |
| 20 | 5 | this.setState({ | client/pages/admin/components/admins/PermissionsForm.jsx | 17 |
| 21 | hydrated: nextProps.details.hydrated, | client/pages/admin/components/admins/PermissionsForm.jsx | 18 | |
| 22 | permissions: nextProps.details.permissions | client/pages/admin/components/admins/PermissionsForm.jsx | 19 | |
| 23 | }); | client/pages/admin/components/admins/PermissionsForm.jsx | 19 | |
| 24 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 20 | |
| 25 | }, | client/pages/admin/components/admins/PermissionsForm.jsx | 21 | |
| 26 | handleNewPermission: function handleNewPermission(event) { | client/pages/admin/components/admins/PermissionsForm.jsx | 23 | |
| 27 | client/pages/admin/components/admins/PermissionsForm.jsx | 23 | ||
| 28 | 10 | var newPermission = this.refs.newPermission.getDOMNode().value.trim(); | client/pages/admin/components/admins/PermissionsForm.jsx | 25 |
| 29 | client/pages/admin/components/admins/PermissionsForm.jsx | 25 | ||
| 30 | 10 | if (!newPermission) { | client/pages/admin/components/admins/PermissionsForm.jsx | 27 |
| 31 | 1 | return; | client/pages/admin/components/admins/PermissionsForm.jsx | 28 |
| 32 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 28 | |
| 33 | client/pages/admin/components/admins/PermissionsForm.jsx | 29 | ||
| 34 | 9 | var nextPermissions = this.state.permissions || {}; | client/pages/admin/components/admins/PermissionsForm.jsx | 31 |
| 35 | 9 | if (nextPermissions.hasOwnProperty(newPermission)) { | client/pages/admin/components/admins/PermissionsForm.jsx | 32 |
| 36 | 2 | this.setState({ error: 'That permission already exists.' }); | client/pages/admin/components/admins/PermissionsForm.jsx | 33 |
| 37 | 2 | setTimeout((function () { | client/pages/admin/components/admins/PermissionsForm.jsx | 34 |
| 38 | client/pages/admin/components/admins/PermissionsForm.jsx | 34 | ||
| 39 | 1 | this.setState({ error: undefined }); | client/pages/admin/components/admins/PermissionsForm.jsx | 36 |
| 40 | }).bind(this), 2500); | client/pages/admin/components/admins/PermissionsForm.jsx | 36 | |
| 41 | } else { | client/pages/admin/components/admins/PermissionsForm.jsx | 37 | |
| 42 | 7 | nextPermissions[newPermission] = true; | client/pages/admin/components/admins/PermissionsForm.jsx | 40 |
| 43 | 7 | this.setState({ permissions: nextPermissions }); | client/pages/admin/components/admins/PermissionsForm.jsx | 41 |
| 44 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 41 | |
| 45 | client/pages/admin/components/admins/PermissionsForm.jsx | 42 | ||
| 46 | 9 | this.setState({ newPermission: '' }); | client/pages/admin/components/admins/PermissionsForm.jsx | 44 |
| 47 | }, | client/pages/admin/components/admins/PermissionsForm.jsx | 44 | |
| 48 | onEnterNewPermission: function onEnterNewPermission(event) { | client/pages/admin/components/admins/PermissionsForm.jsx | 46 | |
| 49 | client/pages/admin/components/admins/PermissionsForm.jsx | 46 | ||
| 50 | 10 | if (event.which === 13) { | client/pages/admin/components/admins/PermissionsForm.jsx | 48 |
| 51 | 9 | event.preventDefault(); | client/pages/admin/components/admins/PermissionsForm.jsx | 49 |
| 52 | 9 | event.stopPropagation(); | client/pages/admin/components/admins/PermissionsForm.jsx | 50 |
| 53 | 9 | this.handleNewPermission(event); | client/pages/admin/components/admins/PermissionsForm.jsx | 51 |
| 54 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 51 | |
| 55 | }, | client/pages/admin/components/admins/PermissionsForm.jsx | 52 | |
| 56 | handleTogglePermission: function handleTogglePermission(key, event) { | client/pages/admin/components/admins/PermissionsForm.jsx | 54 | |
| 57 | client/pages/admin/components/admins/PermissionsForm.jsx | 54 | ||
| 58 | 1 | var nextPermissions = this.state.permissions; | client/pages/admin/components/admins/PermissionsForm.jsx | 56 |
| 59 | 1 | nextPermissions[key] = !nextPermissions[key]; | client/pages/admin/components/admins/PermissionsForm.jsx | 57 |
| 60 | 1 | this.setState({ permissions: nextPermissions }); | client/pages/admin/components/admins/PermissionsForm.jsx | 58 |
| 61 | }, | client/pages/admin/components/admins/PermissionsForm.jsx | 58 | |
| 62 | handleDeletePermission: function handleDeletePermission(key, event) { | client/pages/admin/components/admins/PermissionsForm.jsx | 60 | |
| 63 | client/pages/admin/components/admins/PermissionsForm.jsx | 60 | ||
| 64 | 1 | var nextPermissions = this.state.permissions; | client/pages/admin/components/admins/PermissionsForm.jsx | 62 |
| 65 | 1 | delete nextPermissions[key]; | client/pages/admin/components/admins/PermissionsForm.jsx | 63 |
| 66 | 1 | this.setState({ permissions: nextPermissions }); | client/pages/admin/components/admins/PermissionsForm.jsx | 64 |
| 67 | }, | client/pages/admin/components/admins/PermissionsForm.jsx | 64 | |
| 68 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admins/PermissionsForm.jsx | 66 | |
| 69 | client/pages/admin/components/admins/PermissionsForm.jsx | 66 | ||
| 70 | 1 | event.preventDefault(); | client/pages/admin/components/admins/PermissionsForm.jsx | 68 |
| 71 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/PermissionsForm.jsx | 69 |
| 72 | client/pages/admin/components/admins/PermissionsForm.jsx | 69 | ||
| 73 | 1 | Actions.savePermissions({ | client/pages/admin/components/admins/PermissionsForm.jsx | 71 |
| 74 | id: this.props.details._id, | client/pages/admin/components/admins/PermissionsForm.jsx | 72 | |
| 75 | permissions: this.state.permissions | client/pages/admin/components/admins/PermissionsForm.jsx | 73 | |
| 76 | }); | client/pages/admin/components/admins/PermissionsForm.jsx | 73 | |
| 77 | }, | client/pages/admin/components/admins/PermissionsForm.jsx | 74 | |
| 78 | render: function render() { | client/pages/admin/components/admins/PermissionsForm.jsx | 76 | |
| 79 | client/pages/admin/components/admins/PermissionsForm.jsx | 76 | ||
| 80 | 41 | var alerts = []; | client/pages/admin/components/admins/PermissionsForm.jsx | 78 |
| 81 | 41 | var error = this.props.data.error || this.state.error; | client/pages/admin/components/admins/PermissionsForm.jsx | 79 |
| 82 | 41 | if (this.props.data.success) { | client/pages/admin/components/admins/PermissionsForm.jsx | 80 |
| 83 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 81 |
| 84 | 'div', | client/pages/admin/components/admins/PermissionsForm.jsx | 81 | |
| 85 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 81 | |
| 86 | 'Success. Changes have been saved.' | client/pages/admin/components/admins/PermissionsForm.jsx | 81 | |
| 87 | )); | client/pages/admin/components/admins/PermissionsForm.jsx | 81 | |
| 88 | 40 | } else if (error) { | client/pages/admin/components/admins/PermissionsForm.jsx | 83 |
| 89 | 3 | alerts.push(React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 86 |
| 90 | 'div', | client/pages/admin/components/admins/PermissionsForm.jsx | 86 | |
| 91 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 86 | |
| 92 | error | client/pages/admin/components/admins/PermissionsForm.jsx | 86 | |
| 93 | )); | client/pages/admin/components/admins/PermissionsForm.jsx | 87 | |
| 94 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 88 | |
| 95 | client/pages/admin/components/admins/PermissionsForm.jsx | 89 | ||
| 96 | 41 | var notice; | client/pages/admin/components/admins/PermissionsForm.jsx | 91 |
| 97 | 41 | if (!this.props.details.hydrated) { | client/pages/admin/components/admins/PermissionsForm.jsx | 92 |
| 98 | 12 | notice = React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 93 |
| 99 | 'div', | client/pages/admin/components/admins/PermissionsForm.jsx | 93 | |
| 100 | { className: 'alert alert-info' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 93 | |
| 101 | 'Loading data...' | client/pages/admin/components/admins/PermissionsForm.jsx | 93 | |
| 102 | ); | client/pages/admin/components/admins/PermissionsForm.jsx | 93 | |
| 103 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 95 | |
| 104 | client/pages/admin/components/admins/PermissionsForm.jsx | 96 | ||
| 105 | 41 | var formElements; | client/pages/admin/components/admins/PermissionsForm.jsx | 98 |
| 106 | 41 | if (this.props.details.hydrated) { | client/pages/admin/components/admins/PermissionsForm.jsx | 99 |
| 107 | 29 | var permissions = this.state.permissions || {}; | client/pages/admin/components/admins/PermissionsForm.jsx | 100 |
| 108 | 29 | var permissionKeys = Object.keys(permissions).sort(function (a, b) { | client/pages/admin/components/admins/PermissionsForm.jsx | 101 |
| 109 | client/pages/admin/components/admins/PermissionsForm.jsx | 101 | ||
| 110 | 24 | return a.toLowerCase().localeCompare(b.toLowerCase()); | client/pages/admin/components/admins/PermissionsForm.jsx | 103 |
| 111 | }); | client/pages/admin/components/admins/PermissionsForm.jsx | 103 | |
| 112 | 29 | var permissionsUi = permissionKeys.map((function (key) { | client/pages/admin/components/admins/PermissionsForm.jsx | 105 |
| 113 | client/pages/admin/components/admins/PermissionsForm.jsx | 105 | ||
| 114 | 33 | var deleteHandler = this.handleDeletePermission.bind(this, key); | client/pages/admin/components/admins/PermissionsForm.jsx | 107 |
| 115 | 33 | var toggleHandler = this.handleTogglePermission.bind(this, key); | client/pages/admin/components/admins/PermissionsForm.jsx | 108 |
| 116 | 33 | var toggleIcon; | client/pages/admin/components/admins/PermissionsForm.jsx | 109 |
| 117 | 33 | if (permissions[key]) { | client/pages/admin/components/admins/PermissionsForm.jsx | 110 |
| 118 | 32 | toggleIcon = React.createElement('i', { className: 'fa fa-toggle-on' }); | client/pages/admin/components/admins/PermissionsForm.jsx | 111 |
| 119 | } else { | client/pages/admin/components/admins/PermissionsForm.jsx | 111 | |
| 120 | 1 | toggleIcon = React.createElement('i', { className: 'fa fa-toggle-off' }); | client/pages/admin/components/admins/PermissionsForm.jsx | 114 |
| 121 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 114 | |
| 122 | client/pages/admin/components/admins/PermissionsForm.jsx | 115 | ||
| 123 | 33 | return React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 117 |
| 124 | 'div', | client/pages/admin/components/admins/PermissionsForm.jsx | 118 | |
| 125 | { | client/pages/admin/components/admins/PermissionsForm.jsx | 118 | |
| 126 | key: key, | client/pages/admin/components/admins/PermissionsForm.jsx | 119 | |
| 127 | className: 'input-group' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 120 | |
| 128 | React.createElement('input', { | client/pages/admin/components/admins/PermissionsForm.jsx | 120 | |
| 129 | type: 'text', | client/pages/admin/components/admins/PermissionsForm.jsx | 123 | |
| 130 | name: 'newPermission', | client/pages/admin/components/admins/PermissionsForm.jsx | 124 | |
| 131 | className: 'form-control', | client/pages/admin/components/admins/PermissionsForm.jsx | 125 | |
| 132 | disabled: true, | client/pages/admin/components/admins/PermissionsForm.jsx | 126 | |
| 133 | value: key | client/pages/admin/components/admins/PermissionsForm.jsx | 127 | |
| 134 | }), | client/pages/admin/components/admins/PermissionsForm.jsx | 127 | |
| 135 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 128 | |
| 136 | 'span', | client/pages/admin/components/admins/PermissionsForm.jsx | 129 | |
| 137 | { className: 'input-group-btn' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 129 | |
| 138 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 129 | |
| 139 | 'button', | client/pages/admin/components/admins/PermissionsForm.jsx | 130 | |
| 140 | { | client/pages/admin/components/admins/PermissionsForm.jsx | 130 | |
| 141 | type: 'button', | client/pages/admin/components/admins/PermissionsForm.jsx | 131 | |
| 142 | className: 'btn btn-default', | client/pages/admin/components/admins/PermissionsForm.jsx | 132 | |
| 143 | onClick: toggleHandler }, | client/pages/admin/components/admins/PermissionsForm.jsx | 133 | |
| 144 | toggleIcon | client/pages/admin/components/admins/PermissionsForm.jsx | 133 | |
| 145 | ), | client/pages/admin/components/admins/PermissionsForm.jsx | 135 | |
| 146 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 136 | |
| 147 | 'button', | client/pages/admin/components/admins/PermissionsForm.jsx | 137 | |
| 148 | { | client/pages/admin/components/admins/PermissionsForm.jsx | 137 | |
| 149 | type: 'button', | client/pages/admin/components/admins/PermissionsForm.jsx | 138 | |
| 150 | className: 'btn btn-warning', | client/pages/admin/components/admins/PermissionsForm.jsx | 139 | |
| 151 | onClick: deleteHandler }, | client/pages/admin/components/admins/PermissionsForm.jsx | 140 | |
| 152 | 'Remove' | client/pages/admin/components/admins/PermissionsForm.jsx | 140 | |
| 153 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 140 | |
| 154 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 143 | |
| 155 | ); | client/pages/admin/components/admins/PermissionsForm.jsx | 144 | |
| 156 | }).bind(this)); | client/pages/admin/components/admins/PermissionsForm.jsx | 146 | |
| 157 | client/pages/admin/components/admins/PermissionsForm.jsx | 147 | ||
| 158 | 29 | if (permissionKeys.length === 0) { | client/pages/admin/components/admins/PermissionsForm.jsx | 149 |
| 159 | 14 | permissionsUi = React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 150 |
| 160 | 'div', | client/pages/admin/components/admins/PermissionsForm.jsx | 150 | |
| 161 | null, | client/pages/admin/components/admins/PermissionsForm.jsx | 150 | |
| 162 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 150 | |
| 163 | 'span', | client/pages/admin/components/admins/PermissionsForm.jsx | 151 | |
| 164 | { className: 'label label-default' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 151 | |
| 165 | 'empty list' | client/pages/admin/components/admins/PermissionsForm.jsx | 151 | |
| 166 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 151 | |
| 167 | ); | client/pages/admin/components/admins/PermissionsForm.jsx | 153 | |
| 168 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 154 | |
| 169 | client/pages/admin/components/admins/PermissionsForm.jsx | 155 | ||
| 170 | 29 | formElements = React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 157 |
| 171 | 'fieldset', | client/pages/admin/components/admins/PermissionsForm.jsx | 157 | |
| 172 | null, | client/pages/admin/components/admins/PermissionsForm.jsx | 157 | |
| 173 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 157 | |
| 174 | 'legend', | client/pages/admin/components/admins/PermissionsForm.jsx | 158 | |
| 175 | null, | client/pages/admin/components/admins/PermissionsForm.jsx | 158 | |
| 176 | 'Permissions' | client/pages/admin/components/admins/PermissionsForm.jsx | 158 | |
| 177 | ), | client/pages/admin/components/admins/PermissionsForm.jsx | 158 | |
| 178 | alerts, | client/pages/admin/components/admins/PermissionsForm.jsx | 158 | |
| 179 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 159 | |
| 180 | ControlGroup, | client/pages/admin/components/admins/PermissionsForm.jsx | 160 | |
| 181 | { label: 'Add permission', hideHelp: true }, | client/pages/admin/components/admins/PermissionsForm.jsx | 160 | |
| 182 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 160 | |
| 183 | 'div', | client/pages/admin/components/admins/PermissionsForm.jsx | 161 | |
| 184 | { className: 'input-group' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 161 | |
| 185 | React.createElement('input', { | client/pages/admin/components/admins/PermissionsForm.jsx | 161 | |
| 186 | ref: 'newPermission', | client/pages/admin/components/admins/PermissionsForm.jsx | 163 | |
| 187 | type: 'text', | client/pages/admin/components/admins/PermissionsForm.jsx | 164 | |
| 188 | name: 'newPermission', | client/pages/admin/components/admins/PermissionsForm.jsx | 165 | |
| 189 | className: 'form-control', | client/pages/admin/components/admins/PermissionsForm.jsx | 166 | |
| 190 | placeholder: '', | client/pages/admin/components/admins/PermissionsForm.jsx | 167 | |
| 191 | onKeyDown: this.onEnterNewPermission, | client/pages/admin/components/admins/PermissionsForm.jsx | 168 | |
| 192 | valueLink: this.linkState('newPermission') | client/pages/admin/components/admins/PermissionsForm.jsx | 169 | |
| 193 | }), | client/pages/admin/components/admins/PermissionsForm.jsx | 169 | |
| 194 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 170 | |
| 195 | 'span', | client/pages/admin/components/admins/PermissionsForm.jsx | 171 | |
| 196 | { className: 'input-group-btn' }, | client/pages/admin/components/admins/PermissionsForm.jsx | 171 | |
| 197 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 171 | |
| 198 | 'button', | client/pages/admin/components/admins/PermissionsForm.jsx | 172 | |
| 199 | { | client/pages/admin/components/admins/PermissionsForm.jsx | 172 | |
| 200 | ref: 'newPermissionButton', | client/pages/admin/components/admins/PermissionsForm.jsx | 173 | |
| 201 | type: 'button', | client/pages/admin/components/admins/PermissionsForm.jsx | 174 | |
| 202 | className: 'btn btn-default', | client/pages/admin/components/admins/PermissionsForm.jsx | 175 | |
| 203 | onClick: this.handleNewPermission }, | client/pages/admin/components/admins/PermissionsForm.jsx | 176 | |
| 204 | 'Add' | client/pages/admin/components/admins/PermissionsForm.jsx | 176 | |
| 205 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 176 | |
| 206 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 179 | |
| 207 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 180 | |
| 208 | ), | client/pages/admin/components/admins/PermissionsForm.jsx | 181 | |
| 209 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 182 | |
| 210 | ControlGroup, | client/pages/admin/components/admins/PermissionsForm.jsx | 183 | |
| 211 | { | client/pages/admin/components/admins/PermissionsForm.jsx | 183 | |
| 212 | ref: 'permissionContainer', | client/pages/admin/components/admins/PermissionsForm.jsx | 184 | |
| 213 | label: 'Existing permissions', | client/pages/admin/components/admins/PermissionsForm.jsx | 185 | |
| 214 | hideHelp: true }, | client/pages/admin/components/admins/PermissionsForm.jsx | 186 | |
| 215 | permissionsUi | client/pages/admin/components/admins/PermissionsForm.jsx | 186 | |
| 216 | ), | client/pages/admin/components/admins/PermissionsForm.jsx | 188 | |
| 217 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 189 | |
| 218 | ControlGroup, | client/pages/admin/components/admins/PermissionsForm.jsx | 190 | |
| 219 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admins/PermissionsForm.jsx | 190 | |
| 220 | React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 190 | |
| 221 | Button, | client/pages/admin/components/admins/PermissionsForm.jsx | 191 | |
| 222 | { | client/pages/admin/components/admins/PermissionsForm.jsx | 191 | |
| 223 | type: 'submit', | client/pages/admin/components/admins/PermissionsForm.jsx | 192 | |
| 224 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/admins/PermissionsForm.jsx | 193 | |
| 225 | disabled: this.props.data.loading }, | client/pages/admin/components/admins/PermissionsForm.jsx | 194 | |
| 226 | 'Save changes', | client/pages/admin/components/admins/PermissionsForm.jsx | 194 | |
| 227 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admins/PermissionsForm.jsx | 194 | |
| 228 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 197 | |
| 229 | ) | client/pages/admin/components/admins/PermissionsForm.jsx | 198 | |
| 230 | ); | client/pages/admin/components/admins/PermissionsForm.jsx | 199 | |
| 231 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 200 | |
| 232 | client/pages/admin/components/admins/PermissionsForm.jsx | 201 | ||
| 233 | 41 | return React.createElement( | client/pages/admin/components/admins/PermissionsForm.jsx | 203 |
| 234 | 'form', | client/pages/admin/components/admins/PermissionsForm.jsx | 204 | |
| 235 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admins/PermissionsForm.jsx | 204 | |
| 236 | notice, | client/pages/admin/components/admins/PermissionsForm.jsx | 204 | |
| 237 | formElements | client/pages/admin/components/admins/PermissionsForm.jsx | 205 | |
| 238 | ); | client/pages/admin/components/admins/PermissionsForm.jsx | 206 | |
| 239 | } | client/pages/admin/components/admins/PermissionsForm.jsx | 208 | |
| 240 | }); | client/pages/admin/components/admins/PermissionsForm.jsx | 209 | |
| 241 | client/pages/admin/components/admins/PermissionsForm.jsx | 210 | ||
| 242 | 1 | module.exports = Component; | client/pages/admin/components/admins/PermissionsForm.jsx | 213 |
| 243 | client/pages/admin/components/admins/PermissionsForm.jsx | 213 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/admins/Results.jsx | 1 | |
| 2 | client/pages/admin/components/admins/Results.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/Results.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/admins/Results.jsx | 2 |
| 5 | client/pages/admin/components/admins/Results.jsx | 2 | ||
| 6 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admins/Results.jsx | 5 |
| 7 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/admins/Results.jsx | 6 |
| 8 | client/pages/admin/components/admins/Results.jsx | 6 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/Results.jsx | 9 |
| 10 | displayName: 'Component', | client/pages/admin/components/admins/Results.jsx | 9 | |
| 11 | client/pages/admin/components/admins/Results.jsx | 9 | ||
| 12 | mixins: [LinkedState], | client/pages/admin/components/admins/Results.jsx | 10 | |
| 13 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/admins/Results.jsx | 11 | |
| 14 | client/pages/admin/components/admins/Results.jsx | 11 | ||
| 15 | 1 | return { | client/pages/admin/components/admins/Results.jsx | 13 |
| 16 | data: [] | client/pages/admin/components/admins/Results.jsx | 14 | |
| 17 | }; | client/pages/admin/components/admins/Results.jsx | 14 | |
| 18 | }, | client/pages/admin/components/admins/Results.jsx | 15 | |
| 19 | render: function render() { | client/pages/admin/components/admins/Results.jsx | 17 | |
| 20 | client/pages/admin/components/admins/Results.jsx | 17 | ||
| 21 | 16 | var rows = this.props.data.map(function (record) { | client/pages/admin/components/admins/Results.jsx | 19 |
| 22 | client/pages/admin/components/admins/Results.jsx | 19 | ||
| 23 | 2 | return React.createElement( | client/pages/admin/components/admins/Results.jsx | 21 |
| 24 | 'tr', | client/pages/admin/components/admins/Results.jsx | 22 | |
| 25 | { key: record._id }, | client/pages/admin/components/admins/Results.jsx | 22 | |
| 26 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 22 | |
| 27 | 'td', | client/pages/admin/components/admins/Results.jsx | 23 | |
| 28 | null, | client/pages/admin/components/admins/Results.jsx | 23 | |
| 29 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 23 | |
| 30 | Link, | client/pages/admin/components/admins/Results.jsx | 24 | |
| 31 | { | client/pages/admin/components/admins/Results.jsx | 24 | |
| 32 | className: 'btn btn-default btn-sm', | client/pages/admin/components/admins/Results.jsx | 25 | |
| 33 | to: 'adminDetails', | client/pages/admin/components/admins/Results.jsx | 26 | |
| 34 | params: { id: record._id } }, | client/pages/admin/components/admins/Results.jsx | 27 | |
| 35 | 'Edit' | client/pages/admin/components/admins/Results.jsx | 27 | |
| 36 | ) | client/pages/admin/components/admins/Results.jsx | 27 | |
| 37 | ), | client/pages/admin/components/admins/Results.jsx | 30 | |
| 38 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 31 | |
| 39 | 'td', | client/pages/admin/components/admins/Results.jsx | 32 | |
| 40 | null, | client/pages/admin/components/admins/Results.jsx | 32 | |
| 41 | record.name.first, | client/pages/admin/components/admins/Results.jsx | 32 | |
| 42 | ' ', | client/pages/admin/components/admins/Results.jsx | 32 | |
| 43 | record.name.last | client/pages/admin/components/admins/Results.jsx | 32 | |
| 44 | ), | client/pages/admin/components/admins/Results.jsx | 32 | |
| 45 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 32 | |
| 46 | 'td', | client/pages/admin/components/admins/Results.jsx | 33 | |
| 47 | null, | client/pages/admin/components/admins/Results.jsx | 33 | |
| 48 | record._id | client/pages/admin/components/admins/Results.jsx | 33 | |
| 49 | ) | client/pages/admin/components/admins/Results.jsx | 33 | |
| 50 | ); | client/pages/admin/components/admins/Results.jsx | 33 | |
| 51 | }); | client/pages/admin/components/admins/Results.jsx | 35 | |
| 52 | client/pages/admin/components/admins/Results.jsx | 36 | ||
| 53 | 16 | return React.createElement( | client/pages/admin/components/admins/Results.jsx | 38 |
| 54 | 'div', | client/pages/admin/components/admins/Results.jsx | 39 | |
| 55 | { className: 'table-responsive' }, | client/pages/admin/components/admins/Results.jsx | 39 | |
| 56 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 39 | |
| 57 | 'table', | client/pages/admin/components/admins/Results.jsx | 40 | |
| 58 | { className: 'table table-striped table-results' }, | client/pages/admin/components/admins/Results.jsx | 40 | |
| 59 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 40 | |
| 60 | 'thead', | client/pages/admin/components/admins/Results.jsx | 41 | |
| 61 | null, | client/pages/admin/components/admins/Results.jsx | 41 | |
| 62 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 41 | |
| 63 | 'tr', | client/pages/admin/components/admins/Results.jsx | 42 | |
| 64 | null, | client/pages/admin/components/admins/Results.jsx | 42 | |
| 65 | React.createElement('th', null), | client/pages/admin/components/admins/Results.jsx | 42 | |
| 66 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 43 | |
| 67 | 'th', | client/pages/admin/components/admins/Results.jsx | 44 | |
| 68 | { className: 'stretch' }, | client/pages/admin/components/admins/Results.jsx | 44 | |
| 69 | 'name' | client/pages/admin/components/admins/Results.jsx | 44 | |
| 70 | ), | client/pages/admin/components/admins/Results.jsx | 44 | |
| 71 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 44 | |
| 72 | 'th', | client/pages/admin/components/admins/Results.jsx | 45 | |
| 73 | null, | client/pages/admin/components/admins/Results.jsx | 45 | |
| 74 | 'id' | client/pages/admin/components/admins/Results.jsx | 45 | |
| 75 | ) | client/pages/admin/components/admins/Results.jsx | 45 | |
| 76 | ) | client/pages/admin/components/admins/Results.jsx | 45 | |
| 77 | ), | client/pages/admin/components/admins/Results.jsx | 46 | |
| 78 | React.createElement( | client/pages/admin/components/admins/Results.jsx | 47 | |
| 79 | 'tbody', | client/pages/admin/components/admins/Results.jsx | 48 | |
| 80 | null, | client/pages/admin/components/admins/Results.jsx | 48 | |
| 81 | rows | client/pages/admin/components/admins/Results.jsx | 48 | |
| 82 | ) | client/pages/admin/components/admins/Results.jsx | 49 | |
| 83 | ) | client/pages/admin/components/admins/Results.jsx | 50 | |
| 84 | ); | client/pages/admin/components/admins/Results.jsx | 51 | |
| 85 | } | client/pages/admin/components/admins/Results.jsx | 53 | |
| 86 | }); | client/pages/admin/components/admins/Results.jsx | 54 | |
| 87 | client/pages/admin/components/admins/Results.jsx | 55 | ||
| 88 | 1 | module.exports = Component; | client/pages/admin/components/admins/Results.jsx | 58 |
| 89 | client/pages/admin/components/admins/Results.jsx | 58 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/admins/Search.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/admins/Search.jsx | 2 | |
| 3 | client/pages/admin/components/admins/Search.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/Search.jsx | 2 |
| 5 | 1 | var Paging = require('../../../../components/Paging'); | client/pages/admin/components/admins/Search.jsx | 3 |
| 6 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/Search.jsx | 4 |
| 7 | 1 | var AdminStore = require('../../stores/Admin'); | client/pages/admin/components/admins/Search.jsx | 5 |
| 8 | 1 | var FilterForm = require('./FilterForm'); | client/pages/admin/components/admins/Search.jsx | 6 |
| 9 | 1 | var CreateNewForm = require('./CreateNewForm'); | client/pages/admin/components/admins/Search.jsx | 7 |
| 10 | 1 | var Results = require('./Results'); | client/pages/admin/components/admins/Search.jsx | 8 |
| 11 | client/pages/admin/components/admins/Search.jsx | 8 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/Search.jsx | 11 |
| 13 | displayName: 'Component', | client/pages/admin/components/admins/Search.jsx | 11 | |
| 14 | client/pages/admin/components/admins/Search.jsx | 11 | ||
| 15 | contextTypes: { | client/pages/admin/components/admins/Search.jsx | 12 | |
| 16 | router: React.PropTypes.func | client/pages/admin/components/admins/Search.jsx | 13 | |
| 17 | }, | client/pages/admin/components/admins/Search.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/Search.jsx | 15 | |
| 19 | client/pages/admin/components/admins/Search.jsx | 15 | ||
| 20 | 8 | AdminStore.resetResults(); | client/pages/admin/components/admins/Search.jsx | 17 |
| 21 | 8 | AdminStore.resetCreateNew(); | client/pages/admin/components/admins/Search.jsx | 18 |
| 22 | client/pages/admin/components/admins/Search.jsx | 18 | ||
| 23 | 8 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/admins/Search.jsx | 20 |
| 24 | client/pages/admin/components/admins/Search.jsx | 20 | ||
| 25 | 8 | return { | client/pages/admin/components/admins/Search.jsx | 22 |
| 26 | results: AdminStore.getResults(), | client/pages/admin/components/admins/Search.jsx | 23 | |
| 27 | createNew: AdminStore.getCreateNew() | client/pages/admin/components/admins/Search.jsx | 24 | |
| 28 | }; | client/pages/admin/components/admins/Search.jsx | 24 | |
| 29 | }, | client/pages/admin/components/admins/Search.jsx | 25 | |
| 30 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admins/Search.jsx | 27 | |
| 31 | client/pages/admin/components/admins/Search.jsx | 27 | ||
| 32 | 1 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/admins/Search.jsx | 29 |
| 33 | }, | client/pages/admin/components/admins/Search.jsx | 29 | |
| 34 | componentDidMount: function componentDidMount() { | client/pages/admin/components/admins/Search.jsx | 31 | |
| 35 | client/pages/admin/components/admins/Search.jsx | 31 | ||
| 36 | 8 | AdminStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/admins/Search.jsx | 33 |
| 37 | }, | client/pages/admin/components/admins/Search.jsx | 33 | |
| 38 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/admins/Search.jsx | 35 | |
| 39 | client/pages/admin/components/admins/Search.jsx | 35 | ||
| 40 | 1 | AdminStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/admins/Search.jsx | 37 |
| 41 | }, | client/pages/admin/components/admins/Search.jsx | 37 | |
| 42 | onStoreChange: function onStoreChange() { | client/pages/admin/components/admins/Search.jsx | 39 | |
| 43 | client/pages/admin/components/admins/Search.jsx | 39 | ||
| 44 | 3 | this.setState({ | client/pages/admin/components/admins/Search.jsx | 41 |
| 45 | results: AdminStore.getResults(), | client/pages/admin/components/admins/Search.jsx | 42 | |
| 46 | createNew: AdminStore.getCreateNew() | client/pages/admin/components/admins/Search.jsx | 43 | |
| 47 | }); | client/pages/admin/components/admins/Search.jsx | 43 | |
| 48 | }, | client/pages/admin/components/admins/Search.jsx | 44 | |
| 49 | onFiltersChange: function onFiltersChange(event) { | client/pages/admin/components/admins/Search.jsx | 46 | |
| 50 | client/pages/admin/components/admins/Search.jsx | 46 | ||
| 51 | 3 | if (event) { | client/pages/admin/components/admins/Search.jsx | 48 |
| 52 | 1 | event.preventDefault(); | client/pages/admin/components/admins/Search.jsx | 49 |
| 53 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/Search.jsx | 50 |
| 54 | } | client/pages/admin/components/admins/Search.jsx | 50 | |
| 55 | client/pages/admin/components/admins/Search.jsx | 51 | ||
| 56 | 3 | this.context.router.transitionTo('admins', {}, this.refs.filters.state); | client/pages/admin/components/admins/Search.jsx | 53 |
| 57 | 3 | window.scrollTo(0, 0); | client/pages/admin/components/admins/Search.jsx | 54 |
| 58 | }, | client/pages/admin/components/admins/Search.jsx | 54 | |
| 59 | onPageChange: function onPageChange(page) { | client/pages/admin/components/admins/Search.jsx | 56 | |
| 60 | client/pages/admin/components/admins/Search.jsx | 56 | ||
| 61 | 1 | this.refs.filters.changePage(page); | client/pages/admin/components/admins/Search.jsx | 58 |
| 62 | }, | client/pages/admin/components/admins/Search.jsx | 58 | |
| 63 | onNewClick: function onNewClick() { | client/pages/admin/components/admins/Search.jsx | 60 | |
| 64 | client/pages/admin/components/admins/Search.jsx | 60 | ||
| 65 | 1 | Actions.showCreateNew(); | client/pages/admin/components/admins/Search.jsx | 62 |
| 66 | }, | client/pages/admin/components/admins/Search.jsx | 62 | |
| 67 | render: function render() { | client/pages/admin/components/admins/Search.jsx | 64 | |
| 68 | client/pages/admin/components/admins/Search.jsx | 64 | ||
| 69 | 13 | return React.createElement( | client/pages/admin/components/admins/Search.jsx | 66 |
| 70 | 'section', | client/pages/admin/components/admins/Search.jsx | 67 | |
| 71 | { className: 'section-admins container' }, | client/pages/admin/components/admins/Search.jsx | 67 | |
| 72 | React.createElement( | client/pages/admin/components/admins/Search.jsx | 67 | |
| 73 | 'div', | client/pages/admin/components/admins/Search.jsx | 68 | |
| 74 | { className: 'page-header' }, | client/pages/admin/components/admins/Search.jsx | 68 | |
| 75 | React.createElement( | client/pages/admin/components/admins/Search.jsx | 68 | |
| 76 | 'button', | client/pages/admin/components/admins/Search.jsx | 69 | |
| 77 | { | client/pages/admin/components/admins/Search.jsx | 69 | |
| 78 | ref: 'createNew', | client/pages/admin/components/admins/Search.jsx | 70 | |
| 79 | className: 'btn btn-default pull-right', | client/pages/admin/components/admins/Search.jsx | 71 | |
| 80 | onClick: this.onNewClick }, | client/pages/admin/components/admins/Search.jsx | 72 | |
| 81 | 'Create new' | client/pages/admin/components/admins/Search.jsx | 72 | |
| 82 | ), | client/pages/admin/components/admins/Search.jsx | 72 | |
| 83 | React.createElement( | client/pages/admin/components/admins/Search.jsx | 75 | |
| 84 | 'h1', | client/pages/admin/components/admins/Search.jsx | 76 | |
| 85 | null, | client/pages/admin/components/admins/Search.jsx | 76 | |
| 86 | 'Admins' | client/pages/admin/components/admins/Search.jsx | 76 | |
| 87 | ) | client/pages/admin/components/admins/Search.jsx | 76 | |
| 88 | ), | client/pages/admin/components/admins/Search.jsx | 76 | |
| 89 | React.createElement(FilterForm, { | client/pages/admin/components/admins/Search.jsx | 77 | |
| 90 | ref: 'filters', | client/pages/admin/components/admins/Search.jsx | 79 | |
| 91 | query: this.context.router.getCurrentQuery(), | client/pages/admin/components/admins/Search.jsx | 80 | |
| 92 | loading: this.state.results.loading, | client/pages/admin/components/admins/Search.jsx | 81 | |
| 93 | onChange: this.onFiltersChange | client/pages/admin/components/admins/Search.jsx | 82 | |
| 94 | }), | client/pages/admin/components/admins/Search.jsx | 82 | |
| 95 | React.createElement(Results, { data: this.state.results.data }), | client/pages/admin/components/admins/Search.jsx | 83 | |
| 96 | React.createElement(Paging, { | client/pages/admin/components/admins/Search.jsx | 84 | |
| 97 | ref: 'paging', | client/pages/admin/components/admins/Search.jsx | 86 | |
| 98 | pages: this.state.results.pages, | client/pages/admin/components/admins/Search.jsx | 87 | |
| 99 | items: this.state.results.items, | client/pages/admin/components/admins/Search.jsx | 88 | |
| 100 | loading: this.state.results.loading, | client/pages/admin/components/admins/Search.jsx | 89 | |
| 101 | onChange: this.onPageChange | client/pages/admin/components/admins/Search.jsx | 90 | |
| 102 | }), | client/pages/admin/components/admins/Search.jsx | 90 | |
| 103 | React.createElement(CreateNewForm, { data: this.state.createNew }) | client/pages/admin/components/admins/Search.jsx | 91 | |
| 104 | ); | client/pages/admin/components/admins/Search.jsx | 92 | |
| 105 | } | client/pages/admin/components/admins/Search.jsx | 94 | |
| 106 | }); | client/pages/admin/components/admins/Search.jsx | 95 | |
| 107 | client/pages/admin/components/admins/Search.jsx | 96 | ||
| 108 | 1 | module.exports = Component; | client/pages/admin/components/admins/Search.jsx | 99 |
| 109 | client/pages/admin/components/admins/Search.jsx | 99 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/admins/UserForm.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/admins/UserForm.jsx | 2 | |
| 3 | client/pages/admin/components/admins/UserForm.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/admins/UserForm.jsx | 2 |
| 5 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/admins/UserForm.jsx | 3 |
| 6 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/admins/UserForm.jsx | 4 |
| 7 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/admins/UserForm.jsx | 5 |
| 8 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/admins/UserForm.jsx | 6 |
| 9 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/admins/UserForm.jsx | 7 |
| 10 | 1 | var Actions = require('../../actions/Admin'); | client/pages/admin/components/admins/UserForm.jsx | 8 |
| 11 | client/pages/admin/components/admins/UserForm.jsx | 8 | ||
| 12 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/admins/UserForm.jsx | 11 |
| 13 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/admins/UserForm.jsx | 12 |
| 14 | client/pages/admin/components/admins/UserForm.jsx | 12 | ||
| 15 | 1 | var Component = React.createClass({ | client/pages/admin/components/admins/UserForm.jsx | 15 |
| 16 | displayName: 'Component', | client/pages/admin/components/admins/UserForm.jsx | 15 | |
| 17 | client/pages/admin/components/admins/UserForm.jsx | 15 | ||
| 18 | mixins: [LinkedState], | client/pages/admin/components/admins/UserForm.jsx | 16 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/admins/UserForm.jsx | 17 | |
| 20 | client/pages/admin/components/admins/UserForm.jsx | 17 | ||
| 21 | 13 | return {}; | client/pages/admin/components/admins/UserForm.jsx | 19 |
| 22 | }, | client/pages/admin/components/admins/UserForm.jsx | 19 | |
| 23 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/admins/UserForm.jsx | 21 | |
| 24 | client/pages/admin/components/admins/UserForm.jsx | 21 | ||
| 25 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/admins/UserForm.jsx | 23 |
| 26 | 5 | this.setState({ | client/pages/admin/components/admins/UserForm.jsx | 24 |
| 27 | hydrated: nextProps.details.hydrated, | client/pages/admin/components/admins/UserForm.jsx | 25 | |
| 28 | user: nextProps.details.user | client/pages/admin/components/admins/UserForm.jsx | 26 | |
| 29 | }); | client/pages/admin/components/admins/UserForm.jsx | 26 | |
| 30 | } | client/pages/admin/components/admins/UserForm.jsx | 27 | |
| 31 | }, | client/pages/admin/components/admins/UserForm.jsx | 28 | |
| 32 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/admins/UserForm.jsx | 30 | |
| 33 | client/pages/admin/components/admins/UserForm.jsx | 30 | ||
| 34 | 2 | event.preventDefault(); | client/pages/admin/components/admins/UserForm.jsx | 32 |
| 35 | 2 | event.stopPropagation(); | client/pages/admin/components/admins/UserForm.jsx | 33 |
| 36 | client/pages/admin/components/admins/UserForm.jsx | 33 | ||
| 37 | 2 | if (this.props.details.user) { | client/pages/admin/components/admins/UserForm.jsx | 35 |
| 38 | 1 | Actions.unlinkUser({ | client/pages/admin/components/admins/UserForm.jsx | 36 |
| 39 | id: this.props.details._id | client/pages/admin/components/admins/UserForm.jsx | 37 | |
| 40 | }); | client/pages/admin/components/admins/UserForm.jsx | 37 | |
| 41 | client/pages/admin/components/admins/UserForm.jsx | 38 | ||
| 42 | 1 | this.setState({ username: '' }); | client/pages/admin/components/admins/UserForm.jsx | 40 |
| 43 | } else { | client/pages/admin/components/admins/UserForm.jsx | 40 | |
| 44 | 1 | Actions.linkUser({ | client/pages/admin/components/admins/UserForm.jsx | 43 |
| 45 | id: this.props.details._id, | client/pages/admin/components/admins/UserForm.jsx | 44 | |
| 46 | username: this.state.username | client/pages/admin/components/admins/UserForm.jsx | 45 | |
| 47 | }); | client/pages/admin/components/admins/UserForm.jsx | 45 | |
| 48 | } | client/pages/admin/components/admins/UserForm.jsx | 46 | |
| 49 | }, | client/pages/admin/components/admins/UserForm.jsx | 47 | |
| 50 | onConfirm: function onConfirm(event) { | client/pages/admin/components/admins/UserForm.jsx | 49 | |
| 51 | client/pages/admin/components/admins/UserForm.jsx | 49 | ||
| 52 | 2 | if (!window.confirm('Are you sure?')) { | client/pages/admin/components/admins/UserForm.jsx | 51 |
| 53 | 1 | event.preventDefault(); | client/pages/admin/components/admins/UserForm.jsx | 52 |
| 54 | 1 | event.stopPropagation(); | client/pages/admin/components/admins/UserForm.jsx | 53 |
| 55 | } | client/pages/admin/components/admins/UserForm.jsx | 53 | |
| 56 | }, | client/pages/admin/components/admins/UserForm.jsx | 54 | |
| 57 | render: function render() { | client/pages/admin/components/admins/UserForm.jsx | 56 | |
| 58 | client/pages/admin/components/admins/UserForm.jsx | 56 | ||
| 59 | 20 | var alerts = []; | client/pages/admin/components/admins/UserForm.jsx | 58 |
| 60 | 20 | if (this.props.data.success) { | client/pages/admin/components/admins/UserForm.jsx | 59 |
| 61 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 60 |
| 62 | 'div', | client/pages/admin/components/admins/UserForm.jsx | 60 | |
| 63 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/admins/UserForm.jsx | 60 | |
| 64 | 'Success. Changes have been saved.' | client/pages/admin/components/admins/UserForm.jsx | 60 | |
| 65 | )); | client/pages/admin/components/admins/UserForm.jsx | 60 | |
| 66 | 19 | } else if (this.props.data.error) { | client/pages/admin/components/admins/UserForm.jsx | 62 |
| 67 | 1 | alerts.push(React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 65 |
| 68 | 'div', | client/pages/admin/components/admins/UserForm.jsx | 65 | |
| 69 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/admins/UserForm.jsx | 65 | |
| 70 | this.props.data.error | client/pages/admin/components/admins/UserForm.jsx | 65 | |
| 71 | )); | client/pages/admin/components/admins/UserForm.jsx | 66 | |
| 72 | } | client/pages/admin/components/admins/UserForm.jsx | 67 | |
| 73 | client/pages/admin/components/admins/UserForm.jsx | 68 | ||
| 74 | 20 | var notice; | client/pages/admin/components/admins/UserForm.jsx | 70 |
| 75 | 20 | if (!this.props.details.hydrated) { | client/pages/admin/components/admins/UserForm.jsx | 71 |
| 76 | 14 | notice = React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 72 |
| 77 | 'div', | client/pages/admin/components/admins/UserForm.jsx | 72 | |
| 78 | { className: 'alert alert-info' }, | client/pages/admin/components/admins/UserForm.jsx | 72 | |
| 79 | 'Loading data...' | client/pages/admin/components/admins/UserForm.jsx | 72 | |
| 80 | ); | client/pages/admin/components/admins/UserForm.jsx | 72 | |
| 81 | } | client/pages/admin/components/admins/UserForm.jsx | 74 | |
| 82 | client/pages/admin/components/admins/UserForm.jsx | 75 | ||
| 83 | 20 | var formElements; | client/pages/admin/components/admins/UserForm.jsx | 77 |
| 84 | 20 | if (this.props.details.hydrated) { | client/pages/admin/components/admins/UserForm.jsx | 78 |
| 85 | 6 | var isLinked = Boolean(this.props.details.user); | client/pages/admin/components/admins/UserForm.jsx | 79 |
| 86 | client/pages/admin/components/admins/UserForm.jsx | 79 | ||
| 87 | 6 | var username; | client/pages/admin/components/admins/UserForm.jsx | 81 |
| 88 | 6 | if (isLinked) { | client/pages/admin/components/admins/UserForm.jsx | 82 |
| 89 | 2 | username = React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 83 |
| 90 | ControlGroup, | client/pages/admin/components/admins/UserForm.jsx | 83 | |
| 91 | { label: 'Username' }, | client/pages/admin/components/admins/UserForm.jsx | 83 | |
| 92 | React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 83 | |
| 93 | 'div', | client/pages/admin/components/admins/UserForm.jsx | 84 | |
| 94 | { className: 'input-group' }, | client/pages/admin/components/admins/UserForm.jsx | 84 | |
| 95 | React.createElement('input', { | client/pages/admin/components/admins/UserForm.jsx | 84 | |
| 96 | type: 'text', | client/pages/admin/components/admins/UserForm.jsx | 86 | |
| 97 | className: 'form-control', | client/pages/admin/components/admins/UserForm.jsx | 87 | |
| 98 | disabled: true, | client/pages/admin/components/admins/UserForm.jsx | 88 | |
| 99 | value: this.props.details.user.name | client/pages/admin/components/admins/UserForm.jsx | 89 | |
| 100 | }), | client/pages/admin/components/admins/UserForm.jsx | 89 | |
| 101 | React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 90 | |
| 102 | 'span', | client/pages/admin/components/admins/UserForm.jsx | 91 | |
| 103 | { className: 'input-group-btn' }, | client/pages/admin/components/admins/UserForm.jsx | 91 | |
| 104 | React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 91 | |
| 105 | Link, | client/pages/admin/components/admins/UserForm.jsx | 92 | |
| 106 | { | client/pages/admin/components/admins/UserForm.jsx | 92 | |
| 107 | to: 'userDetails', | client/pages/admin/components/admins/UserForm.jsx | 93 | |
| 108 | params: { id: this.props.details.user.id }, | client/pages/admin/components/admins/UserForm.jsx | 94 | |
| 109 | className: 'btn btn-default' }, | client/pages/admin/components/admins/UserForm.jsx | 95 | |
| 110 | 'View' | client/pages/admin/components/admins/UserForm.jsx | 95 | |
| 111 | ) | client/pages/admin/components/admins/UserForm.jsx | 95 | |
| 112 | ) | client/pages/admin/components/admins/UserForm.jsx | 98 | |
| 113 | ) | client/pages/admin/components/admins/UserForm.jsx | 99 | |
| 114 | ); | client/pages/admin/components/admins/UserForm.jsx | 100 | |
| 115 | } else { | client/pages/admin/components/admins/UserForm.jsx | 101 | |
| 116 | 4 | username = React.createElement(TextControl, { | client/pages/admin/components/admins/UserForm.jsx | 104 |
| 117 | name: 'username', | client/pages/admin/components/admins/UserForm.jsx | 105 | |
| 118 | label: 'Username', | client/pages/admin/components/admins/UserForm.jsx | 106 | |
| 119 | hasError: this.props.data.hasError.username, | client/pages/admin/components/admins/UserForm.jsx | 107 | |
| 120 | valueLink: this.linkState('username'), | client/pages/admin/components/admins/UserForm.jsx | 108 | |
| 121 | help: this.props.data.help.username, | client/pages/admin/components/admins/UserForm.jsx | 109 | |
| 122 | disabled: this.props.data.loading | client/pages/admin/components/admins/UserForm.jsx | 110 | |
| 123 | }); | client/pages/admin/components/admins/UserForm.jsx | 110 | |
| 124 | } | client/pages/admin/components/admins/UserForm.jsx | 111 | |
| 125 | client/pages/admin/components/admins/UserForm.jsx | 112 | ||
| 126 | 6 | formElements = React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 114 |
| 127 | 'fieldset', | client/pages/admin/components/admins/UserForm.jsx | 114 | |
| 128 | null, | client/pages/admin/components/admins/UserForm.jsx | 114 | |
| 129 | React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 114 | |
| 130 | 'legend', | client/pages/admin/components/admins/UserForm.jsx | 115 | |
| 131 | null, | client/pages/admin/components/admins/UserForm.jsx | 115 | |
| 132 | 'User' | client/pages/admin/components/admins/UserForm.jsx | 115 | |
| 133 | ), | client/pages/admin/components/admins/UserForm.jsx | 115 | |
| 134 | alerts, | client/pages/admin/components/admins/UserForm.jsx | 115 | |
| 135 | username, | client/pages/admin/components/admins/UserForm.jsx | 116 | |
| 136 | React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 117 | |
| 137 | ControlGroup, | client/pages/admin/components/admins/UserForm.jsx | 118 | |
| 138 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/admins/UserForm.jsx | 118 | |
| 139 | React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 118 | |
| 140 | Button, | client/pages/admin/components/admins/UserForm.jsx | 119 | |
| 141 | { | client/pages/admin/components/admins/UserForm.jsx | 119 | |
| 142 | type: 'submit', | client/pages/admin/components/admins/UserForm.jsx | 120 | |
| 143 | inputClasses: { | client/pages/admin/components/admins/UserForm.jsx | 121 | |
| 144 | 'btn-primary': !isLinked, | client/pages/admin/components/admins/UserForm.jsx | 122 | |
| 145 | 'btn-danger': isLinked | client/pages/admin/components/admins/UserForm.jsx | 123 | |
| 146 | }, | client/pages/admin/components/admins/UserForm.jsx | 123 | |
| 147 | onClick: isLinked ? this.onConfirm : undefined, | client/pages/admin/components/admins/UserForm.jsx | 125 | |
| 148 | disabled: this.props.data.loading }, | client/pages/admin/components/admins/UserForm.jsx | 126 | |
| 149 | isLinked ? 'Unlink user' : 'Link user', | client/pages/admin/components/admins/UserForm.jsx | 126 | |
| 150 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/admins/UserForm.jsx | 128 | |
| 151 | ) | client/pages/admin/components/admins/UserForm.jsx | 129 | |
| 152 | ) | client/pages/admin/components/admins/UserForm.jsx | 130 | |
| 153 | ); | client/pages/admin/components/admins/UserForm.jsx | 131 | |
| 154 | } | client/pages/admin/components/admins/UserForm.jsx | 132 | |
| 155 | client/pages/admin/components/admins/UserForm.jsx | 133 | ||
| 156 | 20 | return React.createElement( | client/pages/admin/components/admins/UserForm.jsx | 135 |
| 157 | 'form', | client/pages/admin/components/admins/UserForm.jsx | 136 | |
| 158 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/admins/UserForm.jsx | 136 | |
| 159 | notice, | client/pages/admin/components/admins/UserForm.jsx | 136 | |
| 160 | formElements | client/pages/admin/components/admins/UserForm.jsx | 137 | |
| 161 | ); | client/pages/admin/components/admins/UserForm.jsx | 138 | |
| 162 | } | client/pages/admin/components/admins/UserForm.jsx | 140 | |
| 163 | }); | client/pages/admin/components/admins/UserForm.jsx | 141 | |
| 164 | client/pages/admin/components/admins/UserForm.jsx | 142 | ||
| 165 | 1 | module.exports = Component; | client/pages/admin/components/admins/UserForm.jsx | 145 |
| 166 | client/pages/admin/components/admins/UserForm.jsx | 145 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/home/Controller.jsx | 1 | |
| 2 | client/pages/admin/components/home/Controller.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/home/Controller.jsx | 1 |
| 4 | 1 | var Moment = require('moment'); | client/pages/admin/components/home/Controller.jsx | 2 |
| 5 | client/pages/admin/components/home/Controller.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | client/pages/admin/components/home/Controller.jsx | 5 |
| 7 | displayName: 'Component', | client/pages/admin/components/home/Controller.jsx | 5 | |
| 8 | client/pages/admin/components/home/Controller.jsx | 5 | ||
| 9 | getInitialState: function getInitialState() { | client/pages/admin/components/home/Controller.jsx | 6 | |
| 10 | client/pages/admin/components/home/Controller.jsx | 6 | ||
| 11 | 3 | return this.getThisMoment(); | client/pages/admin/components/home/Controller.jsx | 8 |
| 12 | }, | client/pages/admin/components/home/Controller.jsx | 8 | |
| 13 | componentDidMount: function componentDidMount() { | client/pages/admin/components/home/Controller.jsx | 10 | |
| 14 | client/pages/admin/components/home/Controller.jsx | 10 | ||
| 15 | 3 | this.interval = setInterval(this.refreshTime, 1000); | client/pages/admin/components/home/Controller.jsx | 12 |
| 16 | }, | client/pages/admin/components/home/Controller.jsx | 12 | |
| 17 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/home/Controller.jsx | 14 | |
| 18 | client/pages/admin/components/home/Controller.jsx | 14 | ||
| 19 | 3 | clearInterval(this.interval); | client/pages/admin/components/home/Controller.jsx | 16 |
| 20 | }, | client/pages/admin/components/home/Controller.jsx | 16 | |
| 21 | refreshTime: function refreshTime() { | client/pages/admin/components/home/Controller.jsx | 18 | |
| 22 | client/pages/admin/components/home/Controller.jsx | 18 | ||
| 23 | 1 | this.setState(this.getThisMoment()); | client/pages/admin/components/home/Controller.jsx | 20 |
| 24 | }, | client/pages/admin/components/home/Controller.jsx | 20 | |
| 25 | getThisMoment: function getThisMoment() { | client/pages/admin/components/home/Controller.jsx | 22 | |
| 26 | client/pages/admin/components/home/Controller.jsx | 22 | ||
| 27 | 4 | var thisMoment = Moment(); | client/pages/admin/components/home/Controller.jsx | 24 |
| 28 | client/pages/admin/components/home/Controller.jsx | 24 | ||
| 29 | 4 | return { | client/pages/admin/components/home/Controller.jsx | 26 |
| 30 | second: thisMoment.format('ss'), | client/pages/admin/components/home/Controller.jsx | 27 | |
| 31 | minute: thisMoment.format('mm'), | client/pages/admin/components/home/Controller.jsx | 28 | |
| 32 | hour: thisMoment.format('HH'), | client/pages/admin/components/home/Controller.jsx | 29 | |
| 33 | day: thisMoment.format('DD'), | client/pages/admin/components/home/Controller.jsx | 30 | |
| 34 | month: thisMoment.format('MM'), | client/pages/admin/components/home/Controller.jsx | 31 | |
| 35 | year: thisMoment.format('YYYY') | client/pages/admin/components/home/Controller.jsx | 32 | |
| 36 | }; | client/pages/admin/components/home/Controller.jsx | 32 | |
| 37 | }, | client/pages/admin/components/home/Controller.jsx | 33 | |
| 38 | render: function render() { | client/pages/admin/components/home/Controller.jsx | 35 | |
| 39 | client/pages/admin/components/home/Controller.jsx | 35 | ||
| 40 | 4 | return React.createElement( | client/pages/admin/components/home/Controller.jsx | 37 |
| 41 | 'section', | client/pages/admin/components/home/Controller.jsx | 38 | |
| 42 | { className: 'section-home container' }, | client/pages/admin/components/home/Controller.jsx | 38 | |
| 43 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 38 | |
| 44 | 'div', | client/pages/admin/components/home/Controller.jsx | 39 | |
| 45 | { className: 'row' }, | client/pages/admin/components/home/Controller.jsx | 39 | |
| 46 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 39 | |
| 47 | 'div', | client/pages/admin/components/home/Controller.jsx | 40 | |
| 48 | { className: 'col-sm-7' }, | client/pages/admin/components/home/Controller.jsx | 40 | |
| 49 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 40 | |
| 50 | 'h1', | client/pages/admin/components/home/Controller.jsx | 41 | |
| 51 | { className: 'page-header' }, | client/pages/admin/components/home/Controller.jsx | 41 | |
| 52 | 'Admin' | client/pages/admin/components/home/Controller.jsx | 41 | |
| 53 | ), | client/pages/admin/components/home/Controller.jsx | 41 | |
| 54 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 41 | |
| 55 | 'div', | client/pages/admin/components/home/Controller.jsx | 42 | |
| 56 | { className: 'row' }, | client/pages/admin/components/home/Controller.jsx | 42 | |
| 57 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 42 | |
| 58 | 'div', | client/pages/admin/components/home/Controller.jsx | 43 | |
| 59 | { className: 'col-sm-4' }, | client/pages/admin/components/home/Controller.jsx | 43 | |
| 60 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 43 | |
| 61 | 'div', | client/pages/admin/components/home/Controller.jsx | 44 | |
| 62 | { className: 'well text-center' }, | client/pages/admin/components/home/Controller.jsx | 44 | |
| 63 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 44 | |
| 64 | 'div', | client/pages/admin/components/home/Controller.jsx | 45 | |
| 65 | { className: 'stat-value' }, | client/pages/admin/components/home/Controller.jsx | 45 | |
| 66 | this.state.hour | client/pages/admin/components/home/Controller.jsx | 45 | |
| 67 | ), | client/pages/admin/components/home/Controller.jsx | 46 | |
| 68 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 47 | |
| 69 | 'div', | client/pages/admin/components/home/Controller.jsx | 48 | |
| 70 | { className: 'stat-label' }, | client/pages/admin/components/home/Controller.jsx | 48 | |
| 71 | 'hour' | client/pages/admin/components/home/Controller.jsx | 48 | |
| 72 | ) | client/pages/admin/components/home/Controller.jsx | 48 | |
| 73 | ) | client/pages/admin/components/home/Controller.jsx | 48 | |
| 74 | ), | client/pages/admin/components/home/Controller.jsx | 49 | |
| 75 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 50 | |
| 76 | 'div', | client/pages/admin/components/home/Controller.jsx | 51 | |
| 77 | { className: 'col-sm-4' }, | client/pages/admin/components/home/Controller.jsx | 51 | |
| 78 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 51 | |
| 79 | 'div', | client/pages/admin/components/home/Controller.jsx | 52 | |
| 80 | { className: 'well text-center' }, | client/pages/admin/components/home/Controller.jsx | 52 | |
| 81 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 52 | |
| 82 | 'div', | client/pages/admin/components/home/Controller.jsx | 53 | |
| 83 | { className: 'stat-value' }, | client/pages/admin/components/home/Controller.jsx | 53 | |
| 84 | this.state.minute | client/pages/admin/components/home/Controller.jsx | 53 | |
| 85 | ), | client/pages/admin/components/home/Controller.jsx | 54 | |
| 86 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 55 | |
| 87 | 'div', | client/pages/admin/components/home/Controller.jsx | 56 | |
| 88 | { className: 'stat-label' }, | client/pages/admin/components/home/Controller.jsx | 56 | |
| 89 | 'minute' | client/pages/admin/components/home/Controller.jsx | 56 | |
| 90 | ) | client/pages/admin/components/home/Controller.jsx | 56 | |
| 91 | ) | client/pages/admin/components/home/Controller.jsx | 56 | |
| 92 | ), | client/pages/admin/components/home/Controller.jsx | 57 | |
| 93 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 58 | |
| 94 | 'div', | client/pages/admin/components/home/Controller.jsx | 59 | |
| 95 | { className: 'col-sm-4' }, | client/pages/admin/components/home/Controller.jsx | 59 | |
| 96 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 59 | |
| 97 | 'div', | client/pages/admin/components/home/Controller.jsx | 60 | |
| 98 | { className: 'well text-center' }, | client/pages/admin/components/home/Controller.jsx | 60 | |
| 99 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 60 | |
| 100 | 'div', | client/pages/admin/components/home/Controller.jsx | 61 | |
| 101 | { className: 'stat-value' }, | client/pages/admin/components/home/Controller.jsx | 61 | |
| 102 | this.state.second | client/pages/admin/components/home/Controller.jsx | 61 | |
| 103 | ), | client/pages/admin/components/home/Controller.jsx | 62 | |
| 104 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 63 | |
| 105 | 'div', | client/pages/admin/components/home/Controller.jsx | 64 | |
| 106 | { className: 'stat-label' }, | client/pages/admin/components/home/Controller.jsx | 64 | |
| 107 | 'second' | client/pages/admin/components/home/Controller.jsx | 64 | |
| 108 | ) | client/pages/admin/components/home/Controller.jsx | 64 | |
| 109 | ) | client/pages/admin/components/home/Controller.jsx | 64 | |
| 110 | ), | client/pages/admin/components/home/Controller.jsx | 65 | |
| 111 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 66 | |
| 112 | 'div', | client/pages/admin/components/home/Controller.jsx | 67 | |
| 113 | { className: 'col-sm-4' }, | client/pages/admin/components/home/Controller.jsx | 67 | |
| 114 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 67 | |
| 115 | 'div', | client/pages/admin/components/home/Controller.jsx | 68 | |
| 116 | { className: 'well text-center' }, | client/pages/admin/components/home/Controller.jsx | 68 | |
| 117 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 68 | |
| 118 | 'div', | client/pages/admin/components/home/Controller.jsx | 69 | |
| 119 | { className: 'stat-value' }, | client/pages/admin/components/home/Controller.jsx | 69 | |
| 120 | this.state.year | client/pages/admin/components/home/Controller.jsx | 69 | |
| 121 | ), | client/pages/admin/components/home/Controller.jsx | 70 | |
| 122 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 71 | |
| 123 | 'div', | client/pages/admin/components/home/Controller.jsx | 72 | |
| 124 | { className: 'stat-label' }, | client/pages/admin/components/home/Controller.jsx | 72 | |
| 125 | 'year' | client/pages/admin/components/home/Controller.jsx | 72 | |
| 126 | ) | client/pages/admin/components/home/Controller.jsx | 72 | |
| 127 | ) | client/pages/admin/components/home/Controller.jsx | 72 | |
| 128 | ), | client/pages/admin/components/home/Controller.jsx | 73 | |
| 129 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 74 | |
| 130 | 'div', | client/pages/admin/components/home/Controller.jsx | 75 | |
| 131 | { className: 'col-sm-4' }, | client/pages/admin/components/home/Controller.jsx | 75 | |
| 132 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 75 | |
| 133 | 'div', | client/pages/admin/components/home/Controller.jsx | 76 | |
| 134 | { className: 'well text-center' }, | client/pages/admin/components/home/Controller.jsx | 76 | |
| 135 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 76 | |
| 136 | 'div', | client/pages/admin/components/home/Controller.jsx | 77 | |
| 137 | { className: 'stat-value' }, | client/pages/admin/components/home/Controller.jsx | 77 | |
| 138 | this.state.month | client/pages/admin/components/home/Controller.jsx | 77 | |
| 139 | ), | client/pages/admin/components/home/Controller.jsx | 78 | |
| 140 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 79 | |
| 141 | 'div', | client/pages/admin/components/home/Controller.jsx | 80 | |
| 142 | { className: 'stat-label' }, | client/pages/admin/components/home/Controller.jsx | 80 | |
| 143 | 'month' | client/pages/admin/components/home/Controller.jsx | 80 | |
| 144 | ) | client/pages/admin/components/home/Controller.jsx | 80 | |
| 145 | ) | client/pages/admin/components/home/Controller.jsx | 80 | |
| 146 | ), | client/pages/admin/components/home/Controller.jsx | 81 | |
| 147 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 82 | |
| 148 | 'div', | client/pages/admin/components/home/Controller.jsx | 83 | |
| 149 | { className: 'col-sm-4' }, | client/pages/admin/components/home/Controller.jsx | 83 | |
| 150 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 83 | |
| 151 | 'div', | client/pages/admin/components/home/Controller.jsx | 84 | |
| 152 | { className: 'well text-center' }, | client/pages/admin/components/home/Controller.jsx | 84 | |
| 153 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 84 | |
| 154 | 'div', | client/pages/admin/components/home/Controller.jsx | 85 | |
| 155 | { className: 'stat-value' }, | client/pages/admin/components/home/Controller.jsx | 85 | |
| 156 | this.state.day | client/pages/admin/components/home/Controller.jsx | 85 | |
| 157 | ), | client/pages/admin/components/home/Controller.jsx | 86 | |
| 158 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 87 | |
| 159 | 'div', | client/pages/admin/components/home/Controller.jsx | 88 | |
| 160 | { className: 'stat-label' }, | client/pages/admin/components/home/Controller.jsx | 88 | |
| 161 | 'day' | client/pages/admin/components/home/Controller.jsx | 88 | |
| 162 | ) | client/pages/admin/components/home/Controller.jsx | 88 | |
| 163 | ) | client/pages/admin/components/home/Controller.jsx | 88 | |
| 164 | ) | client/pages/admin/components/home/Controller.jsx | 89 | |
| 165 | ) | client/pages/admin/components/home/Controller.jsx | 90 | |
| 166 | ), | client/pages/admin/components/home/Controller.jsx | 91 | |
| 167 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 92 | |
| 168 | 'div', | client/pages/admin/components/home/Controller.jsx | 93 | |
| 169 | { className: 'col-sm-5' }, | client/pages/admin/components/home/Controller.jsx | 93 | |
| 170 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 93 | |
| 171 | 'h1', | client/pages/admin/components/home/Controller.jsx | 94 | |
| 172 | { className: 'page-header' }, | client/pages/admin/components/home/Controller.jsx | 94 | |
| 173 | 'Throttle guage' | client/pages/admin/components/home/Controller.jsx | 94 | |
| 174 | ), | client/pages/admin/components/home/Controller.jsx | 94 | |
| 175 | React.createElement( | client/pages/admin/components/home/Controller.jsx | 94 | |
| 176 | 'div', | client/pages/admin/components/home/Controller.jsx | 95 | |
| 177 | { className: 'text-center' }, | client/pages/admin/components/home/Controller.jsx | 95 | |
| 178 | React.createElement('i', { className: 'fa fa-dashboard bamf' }) | client/pages/admin/components/home/Controller.jsx | 95 | |
| 179 | ) | client/pages/admin/components/home/Controller.jsx | 96 | |
| 180 | ) | client/pages/admin/components/home/Controller.jsx | 97 | |
| 181 | ) | client/pages/admin/components/home/Controller.jsx | 98 | |
| 182 | ); | client/pages/admin/components/home/Controller.jsx | 99 | |
| 183 | } | client/pages/admin/components/home/Controller.jsx | 101 | |
| 184 | }); | client/pages/admin/components/home/Controller.jsx | 102 | |
| 185 | client/pages/admin/components/home/Controller.jsx | 103 | ||
| 186 | 1 | module.exports = Component; | client/pages/admin/components/home/Controller.jsx | 106 |
| 187 | client/pages/admin/components/home/Controller.jsx | 106 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/not-found/Controller.jsx | 1 | |
| 2 | client/pages/admin/components/not-found/Controller.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/not-found/Controller.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/not-found/Controller.jsx | 2 |
| 5 | client/pages/admin/components/not-found/Controller.jsx | 2 | ||
| 6 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/not-found/Controller.jsx | 5 |
| 7 | client/pages/admin/components/not-found/Controller.jsx | 5 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/not-found/Controller.jsx | 8 |
| 9 | displayName: 'Component', | client/pages/admin/components/not-found/Controller.jsx | 8 | |
| 10 | client/pages/admin/components/not-found/Controller.jsx | 8 | ||
| 11 | render: function render() { | client/pages/admin/components/not-found/Controller.jsx | 9 | |
| 12 | client/pages/admin/components/not-found/Controller.jsx | 9 | ||
| 13 | 2 | return React.createElement( | client/pages/admin/components/not-found/Controller.jsx | 11 |
| 14 | 'section', | client/pages/admin/components/not-found/Controller.jsx | 12 | |
| 15 | { className: 'section-not-found container' }, | client/pages/admin/components/not-found/Controller.jsx | 12 | |
| 16 | React.createElement( | client/pages/admin/components/not-found/Controller.jsx | 12 | |
| 17 | 'h1', | client/pages/admin/components/not-found/Controller.jsx | 13 | |
| 18 | { className: 'page-header' }, | client/pages/admin/components/not-found/Controller.jsx | 13 | |
| 19 | 'Not Found' | client/pages/admin/components/not-found/Controller.jsx | 13 | |
| 20 | ), | client/pages/admin/components/not-found/Controller.jsx | 13 | |
| 21 | React.createElement( | client/pages/admin/components/not-found/Controller.jsx | 13 | |
| 22 | 'p', | client/pages/admin/components/not-found/Controller.jsx | 14 | |
| 23 | null, | client/pages/admin/components/not-found/Controller.jsx | 14 | |
| 24 | 'That route didn\'t match any handlers.' | client/pages/admin/components/not-found/Controller.jsx | 14 | |
| 25 | ), | client/pages/admin/components/not-found/Controller.jsx | 14 | |
| 26 | React.createElement( | client/pages/admin/components/not-found/Controller.jsx | 14 | |
| 27 | Link, | client/pages/admin/components/not-found/Controller.jsx | 15 | |
| 28 | { to: 'home' }, | client/pages/admin/components/not-found/Controller.jsx | 15 | |
| 29 | 'Go to home screen' | client/pages/admin/components/not-found/Controller.jsx | 15 | |
| 30 | ) | client/pages/admin/components/not-found/Controller.jsx | 15 | |
| 31 | ); | client/pages/admin/components/not-found/Controller.jsx | 15 | |
| 32 | } | client/pages/admin/components/not-found/Controller.jsx | 17 | |
| 33 | }); | client/pages/admin/components/not-found/Controller.jsx | 18 | |
| 34 | client/pages/admin/components/not-found/Controller.jsx | 19 | ||
| 35 | 1 | module.exports = Component; | client/pages/admin/components/not-found/Controller.jsx | 22 |
| 36 | client/pages/admin/components/not-found/Controller.jsx | 22 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/statuses/CreateNewForm.jsx | 1 | |
| 2 | client/pages/admin/components/statuses/CreateNewForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/statuses/CreateNewForm.jsx | 1 |
| 4 | 1 | var Modal = require('../../../../components/Modal'); | client/pages/admin/components/statuses/CreateNewForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/statuses/CreateNewForm.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/statuses/CreateNewForm.jsx | 4 |
| 7 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/statuses/CreateNewForm.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/statuses/CreateNewForm.jsx | 6 |
| 9 | 1 | var Actions = require('../../actions/Status'); | client/pages/admin/components/statuses/CreateNewForm.jsx | 7 |
| 10 | client/pages/admin/components/statuses/CreateNewForm.jsx | 7 | ||
| 11 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/statuses/CreateNewForm.jsx | 10 |
| 12 | client/pages/admin/components/statuses/CreateNewForm.jsx | 10 | ||
| 13 | 1 | var Component = React.createClass({ | client/pages/admin/components/statuses/CreateNewForm.jsx | 13 |
| 14 | displayName: 'Component', | client/pages/admin/components/statuses/CreateNewForm.jsx | 13 | |
| 15 | client/pages/admin/components/statuses/CreateNewForm.jsx | 13 | ||
| 16 | mixins: [LinkedState], | client/pages/admin/components/statuses/CreateNewForm.jsx | 14 | |
| 17 | contextTypes: { | client/pages/admin/components/statuses/CreateNewForm.jsx | 15 | |
| 18 | router: React.PropTypes.func | client/pages/admin/components/statuses/CreateNewForm.jsx | 16 | |
| 19 | }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 16 | |
| 20 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/statuses/CreateNewForm.jsx | 18 | |
| 21 | client/pages/admin/components/statuses/CreateNewForm.jsx | 18 | ||
| 22 | 1 | return { | client/pages/admin/components/statuses/CreateNewForm.jsx | 20 |
| 23 | data: { | client/pages/admin/components/statuses/CreateNewForm.jsx | 21 | |
| 24 | hasError: {}, | client/pages/admin/components/statuses/CreateNewForm.jsx | 22 | |
| 25 | help: {} | client/pages/admin/components/statuses/CreateNewForm.jsx | 23 | |
| 26 | } | client/pages/admin/components/statuses/CreateNewForm.jsx | 23 | |
| 27 | }; | client/pages/admin/components/statuses/CreateNewForm.jsx | 24 | |
| 28 | }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 25 | |
| 29 | getInitialState: function getInitialState() { | client/pages/admin/components/statuses/CreateNewForm.jsx | 27 | |
| 30 | client/pages/admin/components/statuses/CreateNewForm.jsx | 27 | ||
| 31 | 15 | return {}; | client/pages/admin/components/statuses/CreateNewForm.jsx | 29 |
| 32 | }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 29 | |
| 33 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/statuses/CreateNewForm.jsx | 31 | |
| 34 | client/pages/admin/components/statuses/CreateNewForm.jsx | 31 | ||
| 35 | 2 | clearTimeout(this.timeout); | client/pages/admin/components/statuses/CreateNewForm.jsx | 33 |
| 36 | }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 33 | |
| 37 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/statuses/CreateNewForm.jsx | 35 | |
| 38 | client/pages/admin/components/statuses/CreateNewForm.jsx | 35 | ||
| 39 | 9 | if (!nextProps.data.show) { | client/pages/admin/components/statuses/CreateNewForm.jsx | 37 |
| 40 | 8 | this.replaceState({}); | client/pages/admin/components/statuses/CreateNewForm.jsx | 38 |
| 41 | } else { | client/pages/admin/components/statuses/CreateNewForm.jsx | 38 | |
| 42 | 1 | this.timeout = setTimeout((function () { | client/pages/admin/components/statuses/CreateNewForm.jsx | 41 |
| 43 | client/pages/admin/components/statuses/CreateNewForm.jsx | 41 | ||
| 44 | 1 | this.refs.pivot.refs.inputField.getDOMNode().focus(); | client/pages/admin/components/statuses/CreateNewForm.jsx | 43 |
| 45 | }).bind(this), 100); | client/pages/admin/components/statuses/CreateNewForm.jsx | 43 | |
| 46 | } | client/pages/admin/components/statuses/CreateNewForm.jsx | 44 | |
| 47 | }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 45 | |
| 48 | onSubmit: function onSubmit(event) { | client/pages/admin/components/statuses/CreateNewForm.jsx | 47 | |
| 49 | client/pages/admin/components/statuses/CreateNewForm.jsx | 47 | ||
| 50 | 1 | event.preventDefault(); | client/pages/admin/components/statuses/CreateNewForm.jsx | 49 |
| 51 | 1 | event.stopPropagation(); | client/pages/admin/components/statuses/CreateNewForm.jsx | 50 |
| 52 | client/pages/admin/components/statuses/CreateNewForm.jsx | 50 | ||
| 53 | 1 | Actions.createNew({ | client/pages/admin/components/statuses/CreateNewForm.jsx | 52 |
| 54 | pivot: this.state.pivot, | client/pages/admin/components/statuses/CreateNewForm.jsx | 53 | |
| 55 | name: this.state.name | client/pages/admin/components/statuses/CreateNewForm.jsx | 54 | |
| 56 | }, this.context.router); | client/pages/admin/components/statuses/CreateNewForm.jsx | 54 | |
| 57 | }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 55 | |
| 58 | render: function render() { | client/pages/admin/components/statuses/CreateNewForm.jsx | 57 | |
| 59 | client/pages/admin/components/statuses/CreateNewForm.jsx | 57 | ||
| 60 | 24 | var alerts; | client/pages/admin/components/statuses/CreateNewForm.jsx | 59 |
| 61 | 24 | if (this.props.data.error) { | client/pages/admin/components/statuses/CreateNewForm.jsx | 60 |
| 62 | 1 | alerts = React.createElement( | client/pages/admin/components/statuses/CreateNewForm.jsx | 61 |
| 63 | 'div', | client/pages/admin/components/statuses/CreateNewForm.jsx | 61 | |
| 64 | { className: 'alert alert-danger' }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 61 | |
| 65 | this.props.data.error | client/pages/admin/components/statuses/CreateNewForm.jsx | 61 | |
| 66 | ); | client/pages/admin/components/statuses/CreateNewForm.jsx | 62 | |
| 67 | } | client/pages/admin/components/statuses/CreateNewForm.jsx | 63 | |
| 68 | client/pages/admin/components/statuses/CreateNewForm.jsx | 64 | ||
| 69 | 24 | var notice; | client/pages/admin/components/statuses/CreateNewForm.jsx | 66 |
| 70 | 24 | if (this.props.data.success) { | client/pages/admin/components/statuses/CreateNewForm.jsx | 67 |
| 71 | 1 | notice = React.createElement( | client/pages/admin/components/statuses/CreateNewForm.jsx | 68 |
| 72 | 'div', | client/pages/admin/components/statuses/CreateNewForm.jsx | 68 | |
| 73 | { className: 'alert alert-success' }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 68 | |
| 74 | 'Loading data...' | client/pages/admin/components/statuses/CreateNewForm.jsx | 68 | |
| 75 | ); | client/pages/admin/components/statuses/CreateNewForm.jsx | 68 | |
| 76 | } | client/pages/admin/components/statuses/CreateNewForm.jsx | 70 | |
| 77 | client/pages/admin/components/statuses/CreateNewForm.jsx | 71 | ||
| 78 | 24 | var formElements; | client/pages/admin/components/statuses/CreateNewForm.jsx | 73 |
| 79 | 24 | if (!this.props.data.success) { | client/pages/admin/components/statuses/CreateNewForm.jsx | 74 |
| 80 | 23 | formElements = React.createElement( | client/pages/admin/components/statuses/CreateNewForm.jsx | 75 |
| 81 | 'fieldset', | client/pages/admin/components/statuses/CreateNewForm.jsx | 75 | |
| 82 | null, | client/pages/admin/components/statuses/CreateNewForm.jsx | 75 | |
| 83 | alerts, | client/pages/admin/components/statuses/CreateNewForm.jsx | 75 | |
| 84 | React.createElement(TextControl, { | client/pages/admin/components/statuses/CreateNewForm.jsx | 76 | |
| 85 | name: 'pivot', | client/pages/admin/components/statuses/CreateNewForm.jsx | 78 | |
| 86 | ref: 'pivot', | client/pages/admin/components/statuses/CreateNewForm.jsx | 79 | |
| 87 | label: 'Pivot', | client/pages/admin/components/statuses/CreateNewForm.jsx | 80 | |
| 88 | hasError: this.props.data.hasError.pivot, | client/pages/admin/components/statuses/CreateNewForm.jsx | 81 | |
| 89 | valueLink: this.linkState('pivot'), | client/pages/admin/components/statuses/CreateNewForm.jsx | 82 | |
| 90 | help: this.props.data.help.pivot, | client/pages/admin/components/statuses/CreateNewForm.jsx | 83 | |
| 91 | disabled: this.props.data.loading | client/pages/admin/components/statuses/CreateNewForm.jsx | 84 | |
| 92 | }), | client/pages/admin/components/statuses/CreateNewForm.jsx | 84 | |
| 93 | React.createElement(TextControl, { | client/pages/admin/components/statuses/CreateNewForm.jsx | 85 | |
| 94 | name: 'name', | client/pages/admin/components/statuses/CreateNewForm.jsx | 87 | |
| 95 | label: 'Name', | client/pages/admin/components/statuses/CreateNewForm.jsx | 88 | |
| 96 | hasError: this.props.data.hasError.name, | client/pages/admin/components/statuses/CreateNewForm.jsx | 89 | |
| 97 | valueLink: this.linkState('name'), | client/pages/admin/components/statuses/CreateNewForm.jsx | 90 | |
| 98 | help: this.props.data.help.name, | client/pages/admin/components/statuses/CreateNewForm.jsx | 91 | |
| 99 | disabled: this.props.data.loading | client/pages/admin/components/statuses/CreateNewForm.jsx | 92 | |
| 100 | }), | client/pages/admin/components/statuses/CreateNewForm.jsx | 92 | |
| 101 | React.createElement( | client/pages/admin/components/statuses/CreateNewForm.jsx | 93 | |
| 102 | ControlGroup, | client/pages/admin/components/statuses/CreateNewForm.jsx | 94 | |
| 103 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 94 | |
| 104 | React.createElement( | client/pages/admin/components/statuses/CreateNewForm.jsx | 94 | |
| 105 | Button, | client/pages/admin/components/statuses/CreateNewForm.jsx | 95 | |
| 106 | { | client/pages/admin/components/statuses/CreateNewForm.jsx | 95 | |
| 107 | type: 'submit', | client/pages/admin/components/statuses/CreateNewForm.jsx | 96 | |
| 108 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 97 | |
| 109 | disabled: this.props.data.loading }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 98 | |
| 110 | 'Create new', | client/pages/admin/components/statuses/CreateNewForm.jsx | 98 | |
| 111 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/statuses/CreateNewForm.jsx | 98 | |
| 112 | ) | client/pages/admin/components/statuses/CreateNewForm.jsx | 101 | |
| 113 | ) | client/pages/admin/components/statuses/CreateNewForm.jsx | 102 | |
| 114 | ); | client/pages/admin/components/statuses/CreateNewForm.jsx | 103 | |
| 115 | } | client/pages/admin/components/statuses/CreateNewForm.jsx | 104 | |
| 116 | client/pages/admin/components/statuses/CreateNewForm.jsx | 105 | ||
| 117 | 24 | return React.createElement( | client/pages/admin/components/statuses/CreateNewForm.jsx | 107 |
| 118 | Modal, | client/pages/admin/components/statuses/CreateNewForm.jsx | 108 | |
| 119 | { | client/pages/admin/components/statuses/CreateNewForm.jsx | 108 | |
| 120 | header: 'Create new', | client/pages/admin/components/statuses/CreateNewForm.jsx | 109 | |
| 121 | show: this.props.data.show, | client/pages/admin/components/statuses/CreateNewForm.jsx | 110 | |
| 122 | onClose: Actions.hideCreateNew }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 111 | |
| 123 | React.createElement( | client/pages/admin/components/statuses/CreateNewForm.jsx | 111 | |
| 124 | 'form', | client/pages/admin/components/statuses/CreateNewForm.jsx | 113 | |
| 125 | { onSubmit: this.onSubmit }, | client/pages/admin/components/statuses/CreateNewForm.jsx | 113 | |
| 126 | notice, | client/pages/admin/components/statuses/CreateNewForm.jsx | 113 | |
| 127 | formElements | client/pages/admin/components/statuses/CreateNewForm.jsx | 114 | |
| 128 | ) | client/pages/admin/components/statuses/CreateNewForm.jsx | 115 | |
| 129 | ); | client/pages/admin/components/statuses/CreateNewForm.jsx | 116 | |
| 130 | } | client/pages/admin/components/statuses/CreateNewForm.jsx | 118 | |
| 131 | }); | client/pages/admin/components/statuses/CreateNewForm.jsx | 119 | |
| 132 | client/pages/admin/components/statuses/CreateNewForm.jsx | 120 | ||
| 133 | 1 | module.exports = Component; | client/pages/admin/components/statuses/CreateNewForm.jsx | 123 |
| 134 | client/pages/admin/components/statuses/CreateNewForm.jsx | 123 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/statuses/DeleteForm.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/statuses/DeleteForm.jsx | 2 | |
| 3 | client/pages/admin/components/statuses/DeleteForm.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/statuses/DeleteForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/statuses/DeleteForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/statuses/DeleteForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/statuses/DeleteForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/Status'); | client/pages/admin/components/statuses/DeleteForm.jsx | 6 |
| 9 | client/pages/admin/components/statuses/DeleteForm.jsx | 6 | ||
| 10 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/statuses/DeleteForm.jsx | 9 |
| 11 | client/pages/admin/components/statuses/DeleteForm.jsx | 9 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/statuses/DeleteForm.jsx | 12 |
| 13 | displayName: 'Component', | client/pages/admin/components/statuses/DeleteForm.jsx | 12 | |
| 14 | client/pages/admin/components/statuses/DeleteForm.jsx | 12 | ||
| 15 | mixins: [LinkedState], | client/pages/admin/components/statuses/DeleteForm.jsx | 13 | |
| 16 | contextTypes: { | client/pages/admin/components/statuses/DeleteForm.jsx | 14 | |
| 17 | router: React.PropTypes.func | client/pages/admin/components/statuses/DeleteForm.jsx | 15 | |
| 18 | }, | client/pages/admin/components/statuses/DeleteForm.jsx | 15 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/statuses/DeleteForm.jsx | 17 | |
| 20 | client/pages/admin/components/statuses/DeleteForm.jsx | 17 | ||
| 21 | 10 | return {}; | client/pages/admin/components/statuses/DeleteForm.jsx | 19 |
| 22 | }, | client/pages/admin/components/statuses/DeleteForm.jsx | 19 | |
| 23 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/statuses/DeleteForm.jsx | 21 | |
| 24 | client/pages/admin/components/statuses/DeleteForm.jsx | 21 | ||
| 25 | 1 | event.preventDefault(); | client/pages/admin/components/statuses/DeleteForm.jsx | 23 |
| 26 | 1 | event.stopPropagation(); | client/pages/admin/components/statuses/DeleteForm.jsx | 24 |
| 27 | client/pages/admin/components/statuses/DeleteForm.jsx | 24 | ||
| 28 | 1 | Actions['delete']({ | client/pages/admin/components/statuses/DeleteForm.jsx | 26 |
| 29 | id: this.props.details._id | client/pages/admin/components/statuses/DeleteForm.jsx | 27 | |
| 30 | }, this.context.router); | client/pages/admin/components/statuses/DeleteForm.jsx | 27 | |
| 31 | }, | client/pages/admin/components/statuses/DeleteForm.jsx | 28 | |
| 32 | onConfirm: function onConfirm(event) { | client/pages/admin/components/statuses/DeleteForm.jsx | 30 | |
| 33 | client/pages/admin/components/statuses/DeleteForm.jsx | 30 | ||
| 34 | 2 | if (!window.confirm('Are you sure?')) { | client/pages/admin/components/statuses/DeleteForm.jsx | 32 |
| 35 | 1 | event.preventDefault(); | client/pages/admin/components/statuses/DeleteForm.jsx | 33 |
| 36 | 1 | event.stopPropagation(); | client/pages/admin/components/statuses/DeleteForm.jsx | 34 |
| 37 | } | client/pages/admin/components/statuses/DeleteForm.jsx | 34 | |
| 38 | }, | client/pages/admin/components/statuses/DeleteForm.jsx | 35 | |
| 39 | render: function render() { | client/pages/admin/components/statuses/DeleteForm.jsx | 37 | |
| 40 | client/pages/admin/components/statuses/DeleteForm.jsx | 37 | ||
| 41 | 16 | var alerts; | client/pages/admin/components/statuses/DeleteForm.jsx | 39 |
| 42 | 16 | if (this.props.data.error) { | client/pages/admin/components/statuses/DeleteForm.jsx | 40 |
| 43 | 1 | alerts = React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 41 |
| 44 | 'div', | client/pages/admin/components/statuses/DeleteForm.jsx | 41 | |
| 45 | { className: 'alert alert-danger' }, | client/pages/admin/components/statuses/DeleteForm.jsx | 41 | |
| 46 | this.props.data.error | client/pages/admin/components/statuses/DeleteForm.jsx | 41 | |
| 47 | ); | client/pages/admin/components/statuses/DeleteForm.jsx | 42 | |
| 48 | } | client/pages/admin/components/statuses/DeleteForm.jsx | 43 | |
| 49 | client/pages/admin/components/statuses/DeleteForm.jsx | 44 | ||
| 50 | 16 | return React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 46 |
| 51 | 'form', | client/pages/admin/components/statuses/DeleteForm.jsx | 47 | |
| 52 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/statuses/DeleteForm.jsx | 47 | |
| 53 | React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 47 | |
| 54 | 'fieldset', | client/pages/admin/components/statuses/DeleteForm.jsx | 48 | |
| 55 | null, | client/pages/admin/components/statuses/DeleteForm.jsx | 48 | |
| 56 | React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 48 | |
| 57 | 'legend', | client/pages/admin/components/statuses/DeleteForm.jsx | 49 | |
| 58 | null, | client/pages/admin/components/statuses/DeleteForm.jsx | 49 | |
| 59 | 'Danger zone' | client/pages/admin/components/statuses/DeleteForm.jsx | 49 | |
| 60 | ), | client/pages/admin/components/statuses/DeleteForm.jsx | 49 | |
| 61 | React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 49 | |
| 62 | 'p', | client/pages/admin/components/statuses/DeleteForm.jsx | 50 | |
| 63 | null, | client/pages/admin/components/statuses/DeleteForm.jsx | 50 | |
| 64 | React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 50 | |
| 65 | 'span', | client/pages/admin/components/statuses/DeleteForm.jsx | 51 | |
| 66 | { className: 'label label-danger' }, | client/pages/admin/components/statuses/DeleteForm.jsx | 51 | |
| 67 | 'Warning' | client/pages/admin/components/statuses/DeleteForm.jsx | 51 | |
| 68 | ), | client/pages/admin/components/statuses/DeleteForm.jsx | 51 | |
| 69 | 'Â This cannot be undone and could result in orphaned document relationships.' | client/pages/admin/components/statuses/DeleteForm.jsx | 51 | |
| 70 | ), | client/pages/admin/components/statuses/DeleteForm.jsx | 51 | |
| 71 | alerts, | client/pages/admin/components/statuses/DeleteForm.jsx | 54 | |
| 72 | React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 55 | |
| 73 | ControlGroup, | client/pages/admin/components/statuses/DeleteForm.jsx | 56 | |
| 74 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/statuses/DeleteForm.jsx | 56 | |
| 75 | React.createElement( | client/pages/admin/components/statuses/DeleteForm.jsx | 56 | |
| 76 | Button, | client/pages/admin/components/statuses/DeleteForm.jsx | 57 | |
| 77 | { | client/pages/admin/components/statuses/DeleteForm.jsx | 57 | |
| 78 | type: 'submit', | client/pages/admin/components/statuses/DeleteForm.jsx | 58 | |
| 79 | inputClasses: { 'btn-danger': true }, | client/pages/admin/components/statuses/DeleteForm.jsx | 59 | |
| 80 | disabled: this.props.data.loading, | client/pages/admin/components/statuses/DeleteForm.jsx | 60 | |
| 81 | onClick: this.onConfirm }, | client/pages/admin/components/statuses/DeleteForm.jsx | 61 | |
| 82 | 'Delete', | client/pages/admin/components/statuses/DeleteForm.jsx | 61 | |
| 83 | React.createElement(Spinner, { | client/pages/admin/components/statuses/DeleteForm.jsx | 61 | |
| 84 | space: 'left', | client/pages/admin/components/statuses/DeleteForm.jsx | 65 | |
| 85 | show: this.props.data.loading | client/pages/admin/components/statuses/DeleteForm.jsx | 66 | |
| 86 | }) | client/pages/admin/components/statuses/DeleteForm.jsx | 66 | |
| 87 | ) | client/pages/admin/components/statuses/DeleteForm.jsx | 67 | |
| 88 | ) | client/pages/admin/components/statuses/DeleteForm.jsx | 68 | |
| 89 | ) | client/pages/admin/components/statuses/DeleteForm.jsx | 69 | |
| 90 | ); | client/pages/admin/components/statuses/DeleteForm.jsx | 70 | |
| 91 | } | client/pages/admin/components/statuses/DeleteForm.jsx | 72 | |
| 92 | }); | client/pages/admin/components/statuses/DeleteForm.jsx | 73 | |
| 93 | client/pages/admin/components/statuses/DeleteForm.jsx | 74 | ||
| 94 | 1 | module.exports = Component; | client/pages/admin/components/statuses/DeleteForm.jsx | 77 |
| 95 | client/pages/admin/components/statuses/DeleteForm.jsx | 77 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/statuses/Details.jsx | 1 | |
| 2 | client/pages/admin/components/statuses/Details.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/statuses/Details.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/statuses/Details.jsx | 2 |
| 5 | 1 | var DetailsForm = require('./DetailsForm'); | client/pages/admin/components/statuses/Details.jsx | 3 |
| 6 | 1 | var DeleteForm = require('./DeleteForm'); | client/pages/admin/components/statuses/Details.jsx | 4 |
| 7 | 1 | var StatusStore = require('../../stores/Status'); | client/pages/admin/components/statuses/Details.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/Status'); | client/pages/admin/components/statuses/Details.jsx | 6 |
| 9 | client/pages/admin/components/statuses/Details.jsx | 6 | ||
| 10 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/statuses/Details.jsx | 9 |
| 11 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/statuses/Details.jsx | 10 |
| 12 | client/pages/admin/components/statuses/Details.jsx | 10 | ||
| 13 | 1 | var Component = React.createClass({ | client/pages/admin/components/statuses/Details.jsx | 13 |
| 14 | displayName: 'Component', | client/pages/admin/components/statuses/Details.jsx | 13 | |
| 15 | client/pages/admin/components/statuses/Details.jsx | 13 | ||
| 16 | mixins: [LinkedState], | client/pages/admin/components/statuses/Details.jsx | 14 | |
| 17 | contextTypes: { | client/pages/admin/components/statuses/Details.jsx | 15 | |
| 18 | router: React.PropTypes.func | client/pages/admin/components/statuses/Details.jsx | 16 | |
| 19 | }, | client/pages/admin/components/statuses/Details.jsx | 16 | |
| 20 | getInitialState: function getInitialState() { | client/pages/admin/components/statuses/Details.jsx | 18 | |
| 21 | client/pages/admin/components/statuses/Details.jsx | 18 | ||
| 22 | 4 | StatusStore.resetDetails(); | client/pages/admin/components/statuses/Details.jsx | 20 |
| 23 | 4 | StatusStore.resetDelete(); | client/pages/admin/components/statuses/Details.jsx | 21 |
| 24 | client/pages/admin/components/statuses/Details.jsx | 21 | ||
| 25 | 4 | Actions.getDetails(this.context.router.getCurrentParams()); | client/pages/admin/components/statuses/Details.jsx | 23 |
| 26 | client/pages/admin/components/statuses/Details.jsx | 23 | ||
| 27 | 4 | return { | client/pages/admin/components/statuses/Details.jsx | 25 |
| 28 | details: StatusStore.getDetails(), | client/pages/admin/components/statuses/Details.jsx | 26 | |
| 29 | 'delete': StatusStore.getDelete() | client/pages/admin/components/statuses/Details.jsx | 27 | |
| 30 | }; | client/pages/admin/components/statuses/Details.jsx | 27 | |
| 31 | }, | client/pages/admin/components/statuses/Details.jsx | 28 | |
| 32 | componentDidMount: function componentDidMount() { | client/pages/admin/components/statuses/Details.jsx | 30 | |
| 33 | client/pages/admin/components/statuses/Details.jsx | 30 | ||
| 34 | 4 | StatusStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/statuses/Details.jsx | 32 |
| 35 | }, | client/pages/admin/components/statuses/Details.jsx | 32 | |
| 36 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/statuses/Details.jsx | 34 | |
| 37 | client/pages/admin/components/statuses/Details.jsx | 34 | ||
| 38 | 1 | StatusStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/statuses/Details.jsx | 36 |
| 39 | }, | client/pages/admin/components/statuses/Details.jsx | 36 | |
| 40 | onStoreChange: function onStoreChange() { | client/pages/admin/components/statuses/Details.jsx | 38 | |
| 41 | client/pages/admin/components/statuses/Details.jsx | 38 | ||
| 42 | 2 | this.setState({ | client/pages/admin/components/statuses/Details.jsx | 40 |
| 43 | details: StatusStore.getDetails(), | client/pages/admin/components/statuses/Details.jsx | 41 | |
| 44 | 'delete': StatusStore.getDelete() | client/pages/admin/components/statuses/Details.jsx | 42 | |
| 45 | }); | client/pages/admin/components/statuses/Details.jsx | 42 | |
| 46 | }, | client/pages/admin/components/statuses/Details.jsx | 43 | |
| 47 | render: function render() { | client/pages/admin/components/statuses/Details.jsx | 45 | |
| 48 | client/pages/admin/components/statuses/Details.jsx | 45 | ||
| 49 | 7 | if (this.state.details.hydrated && this.state.details.fetchFailure) { | client/pages/admin/components/statuses/Details.jsx | 47 |
| 50 | 1 | return React.createElement( | client/pages/admin/components/statuses/Details.jsx | 48 |
| 51 | 'section', | client/pages/admin/components/statuses/Details.jsx | 49 | |
| 52 | { className: 'section-status-details container' }, | client/pages/admin/components/statuses/Details.jsx | 49 | |
| 53 | React.createElement( | client/pages/admin/components/statuses/Details.jsx | 49 | |
| 54 | 'h1', | client/pages/admin/components/statuses/Details.jsx | 50 | |
| 55 | { className: 'page-header' }, | client/pages/admin/components/statuses/Details.jsx | 50 | |
| 56 | React.createElement( | client/pages/admin/components/statuses/Details.jsx | 50 | |
| 57 | Link, | client/pages/admin/components/statuses/Details.jsx | 51 | |
| 58 | { to: 'statuses' }, | client/pages/admin/components/statuses/Details.jsx | 51 | |
| 59 | 'Statuses' | client/pages/admin/components/statuses/Details.jsx | 51 | |
| 60 | ), | client/pages/admin/components/statuses/Details.jsx | 51 | |
| 61 | ' / Error' | client/pages/admin/components/statuses/Details.jsx | 51 | |
| 62 | ), | client/pages/admin/components/statuses/Details.jsx | 51 | |
| 63 | React.createElement( | client/pages/admin/components/statuses/Details.jsx | 52 | |
| 64 | 'div', | client/pages/admin/components/statuses/Details.jsx | 53 | |
| 65 | { className: 'alert alert-danger' }, | client/pages/admin/components/statuses/Details.jsx | 53 | |
| 66 | this.state.details.error | client/pages/admin/components/statuses/Details.jsx | 53 | |
| 67 | ) | client/pages/admin/components/statuses/Details.jsx | 54 | |
| 68 | ); | client/pages/admin/components/statuses/Details.jsx | 55 | |
| 69 | } | client/pages/admin/components/statuses/Details.jsx | 57 | |
| 70 | client/pages/admin/components/statuses/Details.jsx | 58 | ||
| 71 | 6 | return React.createElement( | client/pages/admin/components/statuses/Details.jsx | 60 |
| 72 | 'section', | client/pages/admin/components/statuses/Details.jsx | 61 | |
| 73 | { className: 'section-status-details container' }, | client/pages/admin/components/statuses/Details.jsx | 61 | |
| 74 | React.createElement( | client/pages/admin/components/statuses/Details.jsx | 61 | |
| 75 | 'h1', | client/pages/admin/components/statuses/Details.jsx | 62 | |
| 76 | { className: 'page-header' }, | client/pages/admin/components/statuses/Details.jsx | 62 | |
| 77 | React.createElement( | client/pages/admin/components/statuses/Details.jsx | 62 | |
| 78 | Link, | client/pages/admin/components/statuses/Details.jsx | 63 | |
| 79 | { to: 'statuses' }, | client/pages/admin/components/statuses/Details.jsx | 63 | |
| 80 | 'Statuses' | client/pages/admin/components/statuses/Details.jsx | 63 | |
| 81 | ), | client/pages/admin/components/statuses/Details.jsx | 63 | |
| 82 | ' / ', | client/pages/admin/components/statuses/Details.jsx | 63 | |
| 83 | this.state.details.name | client/pages/admin/components/statuses/Details.jsx | 63 | |
| 84 | ), | client/pages/admin/components/statuses/Details.jsx | 63 | |
| 85 | React.createElement( | client/pages/admin/components/statuses/Details.jsx | 64 | |
| 86 | 'div', | client/pages/admin/components/statuses/Details.jsx | 65 | |
| 87 | { className: 'row' }, | client/pages/admin/components/statuses/Details.jsx | 65 | |
| 88 | React.createElement( | client/pages/admin/components/statuses/Details.jsx | 65 | |
| 89 | 'div', | client/pages/admin/components/statuses/Details.jsx | 66 | |
| 90 | { className: 'col-sm-6' }, | client/pages/admin/components/statuses/Details.jsx | 66 | |
| 91 | React.createElement(DetailsForm, { data: this.state.details }), | client/pages/admin/components/statuses/Details.jsx | 66 | |
| 92 | React.createElement(DeleteForm, { | client/pages/admin/components/statuses/Details.jsx | 67 | |
| 93 | details: this.state.details, | client/pages/admin/components/statuses/Details.jsx | 69 | |
| 94 | data: this.state['delete'] | client/pages/admin/components/statuses/Details.jsx | 70 | |
| 95 | }) | client/pages/admin/components/statuses/Details.jsx | 70 | |
| 96 | ) | client/pages/admin/components/statuses/Details.jsx | 71 | |
| 97 | ) | client/pages/admin/components/statuses/Details.jsx | 72 | |
| 98 | ); | client/pages/admin/components/statuses/Details.jsx | 73 | |
| 99 | } | client/pages/admin/components/statuses/Details.jsx | 75 | |
| 100 | }); | client/pages/admin/components/statuses/Details.jsx | 76 | |
| 101 | client/pages/admin/components/statuses/Details.jsx | 77 | ||
| 102 | 1 | module.exports = Component; | client/pages/admin/components/statuses/Details.jsx | 80 |
| 103 | client/pages/admin/components/statuses/Details.jsx | 80 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/statuses/DetailsForm.jsx | 1 | |
| 2 | client/pages/admin/components/statuses/DetailsForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/statuses/DetailsForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/statuses/DetailsForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/statuses/DetailsForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/statuses/DetailsForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/statuses/DetailsForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/Status'); | client/pages/admin/components/statuses/DetailsForm.jsx | 6 |
| 9 | client/pages/admin/components/statuses/DetailsForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/admin/components/statuses/DetailsForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/admin/components/statuses/DetailsForm.jsx | 9 | |
| 12 | client/pages/admin/components/statuses/DetailsForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/statuses/DetailsForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/admin/components/statuses/DetailsForm.jsx | 11 | |
| 15 | client/pages/admin/components/statuses/DetailsForm.jsx | 11 | ||
| 16 | 10 | return {}; | client/pages/admin/components/statuses/DetailsForm.jsx | 13 |
| 17 | }, | client/pages/admin/components/statuses/DetailsForm.jsx | 13 | |
| 18 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/statuses/DetailsForm.jsx | 15 | |
| 19 | client/pages/admin/components/statuses/DetailsForm.jsx | 15 | ||
| 20 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/statuses/DetailsForm.jsx | 17 |
| 21 | 5 | this.setState({ | client/pages/admin/components/statuses/DetailsForm.jsx | 18 |
| 22 | hydrated: nextProps.data.hydrated, | client/pages/admin/components/statuses/DetailsForm.jsx | 19 | |
| 23 | pivot: nextProps.data.pivot, | client/pages/admin/components/statuses/DetailsForm.jsx | 20 | |
| 24 | name: nextProps.data.name | client/pages/admin/components/statuses/DetailsForm.jsx | 21 | |
| 25 | }); | client/pages/admin/components/statuses/DetailsForm.jsx | 21 | |
| 26 | } | client/pages/admin/components/statuses/DetailsForm.jsx | 22 | |
| 27 | }, | client/pages/admin/components/statuses/DetailsForm.jsx | 23 | |
| 28 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/statuses/DetailsForm.jsx | 25 | |
| 29 | client/pages/admin/components/statuses/DetailsForm.jsx | 25 | ||
| 30 | 1 | event.preventDefault(); | client/pages/admin/components/statuses/DetailsForm.jsx | 27 |
| 31 | 1 | event.stopPropagation(); | client/pages/admin/components/statuses/DetailsForm.jsx | 28 |
| 32 | client/pages/admin/components/statuses/DetailsForm.jsx | 28 | ||
| 33 | 1 | Actions.saveDetails({ | client/pages/admin/components/statuses/DetailsForm.jsx | 30 |
| 34 | id: this.props.data._id, | client/pages/admin/components/statuses/DetailsForm.jsx | 31 | |
| 35 | name: this.state.name | client/pages/admin/components/statuses/DetailsForm.jsx | 32 | |
| 36 | }); | client/pages/admin/components/statuses/DetailsForm.jsx | 32 | |
| 37 | }, | client/pages/admin/components/statuses/DetailsForm.jsx | 33 | |
| 38 | render: function render() { | client/pages/admin/components/statuses/DetailsForm.jsx | 35 | |
| 39 | client/pages/admin/components/statuses/DetailsForm.jsx | 35 | ||
| 40 | 16 | var alerts = []; | client/pages/admin/components/statuses/DetailsForm.jsx | 37 |
| 41 | 16 | if (this.props.data.success) { | client/pages/admin/components/statuses/DetailsForm.jsx | 38 |
| 42 | 1 | alerts.push(React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 39 |
| 43 | 'div', | client/pages/admin/components/statuses/DetailsForm.jsx | 39 | |
| 44 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/statuses/DetailsForm.jsx | 39 | |
| 45 | 'Success. Changes have been saved.' | client/pages/admin/components/statuses/DetailsForm.jsx | 39 | |
| 46 | )); | client/pages/admin/components/statuses/DetailsForm.jsx | 39 | |
| 47 | 15 | } else if (this.props.data.error) { | client/pages/admin/components/statuses/DetailsForm.jsx | 41 |
| 48 | 1 | alerts.push(React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 44 |
| 49 | 'div', | client/pages/admin/components/statuses/DetailsForm.jsx | 44 | |
| 50 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/statuses/DetailsForm.jsx | 44 | |
| 51 | this.props.data.error | client/pages/admin/components/statuses/DetailsForm.jsx | 44 | |
| 52 | )); | client/pages/admin/components/statuses/DetailsForm.jsx | 45 | |
| 53 | } | client/pages/admin/components/statuses/DetailsForm.jsx | 46 | |
| 54 | client/pages/admin/components/statuses/DetailsForm.jsx | 47 | ||
| 55 | 16 | var notice; | client/pages/admin/components/statuses/DetailsForm.jsx | 49 |
| 56 | 16 | if (!this.props.data.hydrated) { | client/pages/admin/components/statuses/DetailsForm.jsx | 50 |
| 57 | 12 | notice = React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 51 |
| 58 | 'div', | client/pages/admin/components/statuses/DetailsForm.jsx | 51 | |
| 59 | { className: 'alert alert-info' }, | client/pages/admin/components/statuses/DetailsForm.jsx | 51 | |
| 60 | 'Loading data...' | client/pages/admin/components/statuses/DetailsForm.jsx | 51 | |
| 61 | ); | client/pages/admin/components/statuses/DetailsForm.jsx | 51 | |
| 62 | } | client/pages/admin/components/statuses/DetailsForm.jsx | 53 | |
| 63 | client/pages/admin/components/statuses/DetailsForm.jsx | 54 | ||
| 64 | 16 | var formElements; | client/pages/admin/components/statuses/DetailsForm.jsx | 56 |
| 65 | 16 | if (this.props.data.hydrated) { | client/pages/admin/components/statuses/DetailsForm.jsx | 57 |
| 66 | 4 | formElements = React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 58 |
| 67 | 'fieldset', | client/pages/admin/components/statuses/DetailsForm.jsx | 58 | |
| 68 | null, | client/pages/admin/components/statuses/DetailsForm.jsx | 58 | |
| 69 | React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 58 | |
| 70 | 'legend', | client/pages/admin/components/statuses/DetailsForm.jsx | 59 | |
| 71 | null, | client/pages/admin/components/statuses/DetailsForm.jsx | 59 | |
| 72 | 'Details' | client/pages/admin/components/statuses/DetailsForm.jsx | 59 | |
| 73 | ), | client/pages/admin/components/statuses/DetailsForm.jsx | 59 | |
| 74 | alerts, | client/pages/admin/components/statuses/DetailsForm.jsx | 59 | |
| 75 | React.createElement(TextControl, { | client/pages/admin/components/statuses/DetailsForm.jsx | 60 | |
| 76 | name: 'pivot', | client/pages/admin/components/statuses/DetailsForm.jsx | 62 | |
| 77 | label: 'Pivot', | client/pages/admin/components/statuses/DetailsForm.jsx | 63 | |
| 78 | hasError: this.props.data.hasError.pivot, | client/pages/admin/components/statuses/DetailsForm.jsx | 64 | |
| 79 | valueLink: this.linkState('pivot'), | client/pages/admin/components/statuses/DetailsForm.jsx | 65 | |
| 80 | help: this.props.data.help.pivot, | client/pages/admin/components/statuses/DetailsForm.jsx | 66 | |
| 81 | disabled: true | client/pages/admin/components/statuses/DetailsForm.jsx | 67 | |
| 82 | }), | client/pages/admin/components/statuses/DetailsForm.jsx | 67 | |
| 83 | React.createElement(TextControl, { | client/pages/admin/components/statuses/DetailsForm.jsx | 68 | |
| 84 | name: 'name', | client/pages/admin/components/statuses/DetailsForm.jsx | 70 | |
| 85 | label: 'Name', | client/pages/admin/components/statuses/DetailsForm.jsx | 71 | |
| 86 | hasError: this.props.data.hasError.name, | client/pages/admin/components/statuses/DetailsForm.jsx | 72 | |
| 87 | valueLink: this.linkState('name'), | client/pages/admin/components/statuses/DetailsForm.jsx | 73 | |
| 88 | help: this.props.data.help.name, | client/pages/admin/components/statuses/DetailsForm.jsx | 74 | |
| 89 | disabled: this.props.data.loading | client/pages/admin/components/statuses/DetailsForm.jsx | 75 | |
| 90 | }), | client/pages/admin/components/statuses/DetailsForm.jsx | 75 | |
| 91 | React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 76 | |
| 92 | ControlGroup, | client/pages/admin/components/statuses/DetailsForm.jsx | 77 | |
| 93 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/statuses/DetailsForm.jsx | 77 | |
| 94 | React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 77 | |
| 95 | Button, | client/pages/admin/components/statuses/DetailsForm.jsx | 78 | |
| 96 | { | client/pages/admin/components/statuses/DetailsForm.jsx | 78 | |
| 97 | type: 'submit', | client/pages/admin/components/statuses/DetailsForm.jsx | 79 | |
| 98 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/statuses/DetailsForm.jsx | 80 | |
| 99 | disabled: this.props.data.loading }, | client/pages/admin/components/statuses/DetailsForm.jsx | 81 | |
| 100 | 'Save changes', | client/pages/admin/components/statuses/DetailsForm.jsx | 81 | |
| 101 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/statuses/DetailsForm.jsx | 81 | |
| 102 | ) | client/pages/admin/components/statuses/DetailsForm.jsx | 84 | |
| 103 | ) | client/pages/admin/components/statuses/DetailsForm.jsx | 85 | |
| 104 | ); | client/pages/admin/components/statuses/DetailsForm.jsx | 86 | |
| 105 | } | client/pages/admin/components/statuses/DetailsForm.jsx | 87 | |
| 106 | client/pages/admin/components/statuses/DetailsForm.jsx | 88 | ||
| 107 | 16 | return React.createElement( | client/pages/admin/components/statuses/DetailsForm.jsx | 90 |
| 108 | 'form', | client/pages/admin/components/statuses/DetailsForm.jsx | 91 | |
| 109 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/statuses/DetailsForm.jsx | 91 | |
| 110 | notice, | client/pages/admin/components/statuses/DetailsForm.jsx | 91 | |
| 111 | formElements | client/pages/admin/components/statuses/DetailsForm.jsx | 92 | |
| 112 | ); | client/pages/admin/components/statuses/DetailsForm.jsx | 93 | |
| 113 | } | client/pages/admin/components/statuses/DetailsForm.jsx | 95 | |
| 114 | }); | client/pages/admin/components/statuses/DetailsForm.jsx | 96 | |
| 115 | client/pages/admin/components/statuses/DetailsForm.jsx | 97 | ||
| 116 | 1 | module.exports = Component; | client/pages/admin/components/statuses/DetailsForm.jsx | 100 |
| 117 | client/pages/admin/components/statuses/DetailsForm.jsx | 100 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/statuses/FilterForm.jsx | 1 | |
| 2 | client/pages/admin/components/statuses/FilterForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/statuses/FilterForm.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/pages/admin/components/statuses/FilterForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/statuses/FilterForm.jsx | 3 |
| 6 | 1 | var SelectControl = require('../../../../components/form/SelectControl'); | client/pages/admin/components/statuses/FilterForm.jsx | 4 |
| 7 | client/pages/admin/components/statuses/FilterForm.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/statuses/FilterForm.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/statuses/FilterForm.jsx | 7 | |
| 10 | client/pages/admin/components/statuses/FilterForm.jsx | 7 | ||
| 11 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/statuses/FilterForm.jsx | 8 | |
| 12 | defaultState: { | client/pages/admin/components/statuses/FilterForm.jsx | 9 | |
| 13 | pivot: '', | client/pages/admin/components/statuses/FilterForm.jsx | 10 | |
| 14 | name: '', | client/pages/admin/components/statuses/FilterForm.jsx | 11 | |
| 15 | sort: '_id', | client/pages/admin/components/statuses/FilterForm.jsx | 12 | |
| 16 | limit: 20, | client/pages/admin/components/statuses/FilterForm.jsx | 13 | |
| 17 | page: 1 | client/pages/admin/components/statuses/FilterForm.jsx | 14 | |
| 18 | }, | client/pages/admin/components/statuses/FilterForm.jsx | 14 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/statuses/FilterForm.jsx | 16 | |
| 20 | client/pages/admin/components/statuses/FilterForm.jsx | 16 | ||
| 21 | 14 | return ObjectAssign({}, this.defaultState, this.props.query); | client/pages/admin/components/statuses/FilterForm.jsx | 18 |
| 22 | }, | client/pages/admin/components/statuses/FilterForm.jsx | 18 | |
| 23 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/statuses/FilterForm.jsx | 20 | |
| 24 | client/pages/admin/components/statuses/FilterForm.jsx | 20 | ||
| 25 | 6 | var nextState = ObjectAssign({}, this.defaultState, nextProps.query); | client/pages/admin/components/statuses/FilterForm.jsx | 22 |
| 26 | 6 | this.setState(nextState); | client/pages/admin/components/statuses/FilterForm.jsx | 23 |
| 27 | }, | client/pages/admin/components/statuses/FilterForm.jsx | 23 | |
| 28 | onMenuChange: function onMenuChange(event) { | client/pages/admin/components/statuses/FilterForm.jsx | 25 | |
| 29 | client/pages/admin/components/statuses/FilterForm.jsx | 25 | ||
| 30 | 2 | var newState = { page: 1 }; | client/pages/admin/components/statuses/FilterForm.jsx | 27 |
| 31 | 2 | newState[event.target.name] = event.target.value; | client/pages/admin/components/statuses/FilterForm.jsx | 28 |
| 32 | 2 | this.setState(newState, this.props.onChange); | client/pages/admin/components/statuses/FilterForm.jsx | 29 |
| 33 | }, | client/pages/admin/components/statuses/FilterForm.jsx | 29 | |
| 34 | onEnterSubmit: function onEnterSubmit(event) { | client/pages/admin/components/statuses/FilterForm.jsx | 31 | |
| 35 | client/pages/admin/components/statuses/FilterForm.jsx | 31 | ||
| 36 | 2 | if (event.which === 13) { | client/pages/admin/components/statuses/FilterForm.jsx | 33 |
| 37 | 1 | event.preventDefault(); | client/pages/admin/components/statuses/FilterForm.jsx | 34 |
| 38 | 1 | event.stopPropagation(); | client/pages/admin/components/statuses/FilterForm.jsx | 35 |
| 39 | 1 | this.setState({ page: 1 }, this.props.onChange); | client/pages/admin/components/statuses/FilterForm.jsx | 36 |
| 40 | } | client/pages/admin/components/statuses/FilterForm.jsx | 36 | |
| 41 | }, | client/pages/admin/components/statuses/FilterForm.jsx | 37 | |
| 42 | changePage: function changePage(page) { | client/pages/admin/components/statuses/FilterForm.jsx | 39 | |
| 43 | client/pages/admin/components/statuses/FilterForm.jsx | 39 | ||
| 44 | 2 | this.setState({ page: page }, this.props.onChange); | client/pages/admin/components/statuses/FilterForm.jsx | 41 |
| 45 | }, | client/pages/admin/components/statuses/FilterForm.jsx | 41 | |
| 46 | render: function render() { | client/pages/admin/components/statuses/FilterForm.jsx | 43 | |
| 47 | client/pages/admin/components/statuses/FilterForm.jsx | 43 | ||
| 48 | 25 | return React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 45 |
| 49 | 'form', | client/pages/admin/components/statuses/FilterForm.jsx | 46 | |
| 50 | { onKeyDown: this.onEnterSubmit, onSubmit: this.props.onChange }, | client/pages/admin/components/statuses/FilterForm.jsx | 46 | |
| 51 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 46 | |
| 52 | 'div', | client/pages/admin/components/statuses/FilterForm.jsx | 47 | |
| 53 | { className: 'row' }, | client/pages/admin/components/statuses/FilterForm.jsx | 47 | |
| 54 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 47 | |
| 55 | 'div', | client/pages/admin/components/statuses/FilterForm.jsx | 48 | |
| 56 | { className: 'col-sm-3' }, | client/pages/admin/components/statuses/FilterForm.jsx | 48 | |
| 57 | React.createElement(TextControl, { | client/pages/admin/components/statuses/FilterForm.jsx | 48 | |
| 58 | name: 'pivot', | client/pages/admin/components/statuses/FilterForm.jsx | 50 | |
| 59 | label: 'Pivot search', | client/pages/admin/components/statuses/FilterForm.jsx | 51 | |
| 60 | valueLink: this.linkState('pivot'), | client/pages/admin/components/statuses/FilterForm.jsx | 52 | |
| 61 | disabled: this.props.loading | client/pages/admin/components/statuses/FilterForm.jsx | 53 | |
| 62 | }) | client/pages/admin/components/statuses/FilterForm.jsx | 53 | |
| 63 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 54 | |
| 64 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 55 | |
| 65 | 'div', | client/pages/admin/components/statuses/FilterForm.jsx | 56 | |
| 66 | { className: 'col-sm-3' }, | client/pages/admin/components/statuses/FilterForm.jsx | 56 | |
| 67 | React.createElement(TextControl, { | client/pages/admin/components/statuses/FilterForm.jsx | 56 | |
| 68 | name: 'name', | client/pages/admin/components/statuses/FilterForm.jsx | 58 | |
| 69 | label: 'Name search', | client/pages/admin/components/statuses/FilterForm.jsx | 59 | |
| 70 | valueLink: this.linkState('name'), | client/pages/admin/components/statuses/FilterForm.jsx | 60 | |
| 71 | disabled: this.props.loading | client/pages/admin/components/statuses/FilterForm.jsx | 61 | |
| 72 | }) | client/pages/admin/components/statuses/FilterForm.jsx | 61 | |
| 73 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 62 | |
| 74 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 63 | |
| 75 | 'div', | client/pages/admin/components/statuses/FilterForm.jsx | 64 | |
| 76 | { className: 'col-sm-3' }, | client/pages/admin/components/statuses/FilterForm.jsx | 64 | |
| 77 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 64 | |
| 78 | SelectControl, | client/pages/admin/components/statuses/FilterForm.jsx | 65 | |
| 79 | { | client/pages/admin/components/statuses/FilterForm.jsx | 65 | |
| 80 | name: 'sort', | client/pages/admin/components/statuses/FilterForm.jsx | 66 | |
| 81 | label: 'Sort by', | client/pages/admin/components/statuses/FilterForm.jsx | 67 | |
| 82 | disabled: this.props.loading, | client/pages/admin/components/statuses/FilterForm.jsx | 68 | |
| 83 | onChange: this.onMenuChange, | client/pages/admin/components/statuses/FilterForm.jsx | 69 | |
| 84 | value: this.state.sort }, | client/pages/admin/components/statuses/FilterForm.jsx | 70 | |
| 85 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 70 | |
| 86 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 72 | |
| 87 | { value: '_id' }, | client/pages/admin/components/statuses/FilterForm.jsx | 72 | |
| 88 | 'id â–²' | client/pages/admin/components/statuses/FilterForm.jsx | 72 | |
| 89 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 72 | |
| 90 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 72 | |
| 91 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 73 | |
| 92 | { value: '-_id' }, | client/pages/admin/components/statuses/FilterForm.jsx | 73 | |
| 93 | 'id â–¼' | client/pages/admin/components/statuses/FilterForm.jsx | 73 | |
| 94 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 73 | |
| 95 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 73 | |
| 96 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 74 | |
| 97 | { value: 'name' }, | client/pages/admin/components/statuses/FilterForm.jsx | 74 | |
| 98 | 'name â–²' | client/pages/admin/components/statuses/FilterForm.jsx | 74 | |
| 99 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 74 | |
| 100 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 74 | |
| 101 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 75 | |
| 102 | { value: '-name' }, | client/pages/admin/components/statuses/FilterForm.jsx | 75 | |
| 103 | 'name â–¼' | client/pages/admin/components/statuses/FilterForm.jsx | 75 | |
| 104 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 75 | |
| 105 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 75 | |
| 106 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 76 | |
| 107 | { value: 'pivot' }, | client/pages/admin/components/statuses/FilterForm.jsx | 76 | |
| 108 | 'pivot â–²' | client/pages/admin/components/statuses/FilterForm.jsx | 76 | |
| 109 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 76 | |
| 110 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 76 | |
| 111 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 77 | |
| 112 | { value: '-pivot' }, | client/pages/admin/components/statuses/FilterForm.jsx | 77 | |
| 113 | 'pivot â–¼' | client/pages/admin/components/statuses/FilterForm.jsx | 77 | |
| 114 | ) | client/pages/admin/components/statuses/FilterForm.jsx | 77 | |
| 115 | ) | client/pages/admin/components/statuses/FilterForm.jsx | 77 | |
| 116 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 78 | |
| 117 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 79 | |
| 118 | 'div', | client/pages/admin/components/statuses/FilterForm.jsx | 80 | |
| 119 | { className: 'col-sm-3' }, | client/pages/admin/components/statuses/FilterForm.jsx | 80 | |
| 120 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 80 | |
| 121 | SelectControl, | client/pages/admin/components/statuses/FilterForm.jsx | 81 | |
| 122 | { | client/pages/admin/components/statuses/FilterForm.jsx | 81 | |
| 123 | name: 'limit', | client/pages/admin/components/statuses/FilterForm.jsx | 82 | |
| 124 | label: 'Limit', | client/pages/admin/components/statuses/FilterForm.jsx | 83 | |
| 125 | disabled: this.props.loading, | client/pages/admin/components/statuses/FilterForm.jsx | 84 | |
| 126 | onChange: this.onMenuChange, | client/pages/admin/components/statuses/FilterForm.jsx | 85 | |
| 127 | value: this.state.limit }, | client/pages/admin/components/statuses/FilterForm.jsx | 86 | |
| 128 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 86 | |
| 129 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 88 | |
| 130 | { value: 10 }, | client/pages/admin/components/statuses/FilterForm.jsx | 88 | |
| 131 | '10 items' | client/pages/admin/components/statuses/FilterForm.jsx | 88 | |
| 132 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 88 | |
| 133 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 88 | |
| 134 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 89 | |
| 135 | { value: 20 }, | client/pages/admin/components/statuses/FilterForm.jsx | 89 | |
| 136 | '20 items' | client/pages/admin/components/statuses/FilterForm.jsx | 89 | |
| 137 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 89 | |
| 138 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 89 | |
| 139 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 90 | |
| 140 | { value: 50 }, | client/pages/admin/components/statuses/FilterForm.jsx | 90 | |
| 141 | '50 items' | client/pages/admin/components/statuses/FilterForm.jsx | 90 | |
| 142 | ), | client/pages/admin/components/statuses/FilterForm.jsx | 90 | |
| 143 | React.createElement( | client/pages/admin/components/statuses/FilterForm.jsx | 90 | |
| 144 | 'option', | client/pages/admin/components/statuses/FilterForm.jsx | 91 | |
| 145 | { value: 100 }, | client/pages/admin/components/statuses/FilterForm.jsx | 91 | |
| 146 | '100 items' | client/pages/admin/components/statuses/FilterForm.jsx | 91 | |
| 147 | ) | client/pages/admin/components/statuses/FilterForm.jsx | 91 | |
| 148 | ) | client/pages/admin/components/statuses/FilterForm.jsx | 91 | |
| 149 | ) | client/pages/admin/components/statuses/FilterForm.jsx | 92 | |
| 150 | ) | client/pages/admin/components/statuses/FilterForm.jsx | 93 | |
| 151 | ); | client/pages/admin/components/statuses/FilterForm.jsx | 94 | |
| 152 | } | client/pages/admin/components/statuses/FilterForm.jsx | 96 | |
| 153 | }); | client/pages/admin/components/statuses/FilterForm.jsx | 97 | |
| 154 | client/pages/admin/components/statuses/FilterForm.jsx | 98 | ||
| 155 | 1 | module.exports = Component; | client/pages/admin/components/statuses/FilterForm.jsx | 101 |
| 156 | client/pages/admin/components/statuses/FilterForm.jsx | 101 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/statuses/Results.jsx | 1 | |
| 2 | client/pages/admin/components/statuses/Results.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/statuses/Results.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/statuses/Results.jsx | 2 |
| 5 | client/pages/admin/components/statuses/Results.jsx | 2 | ||
| 6 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/statuses/Results.jsx | 5 |
| 7 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/statuses/Results.jsx | 6 |
| 8 | client/pages/admin/components/statuses/Results.jsx | 6 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/statuses/Results.jsx | 9 |
| 10 | displayName: 'Component', | client/pages/admin/components/statuses/Results.jsx | 9 | |
| 11 | client/pages/admin/components/statuses/Results.jsx | 9 | ||
| 12 | mixins: [LinkedState], | client/pages/admin/components/statuses/Results.jsx | 10 | |
| 13 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/statuses/Results.jsx | 11 | |
| 14 | client/pages/admin/components/statuses/Results.jsx | 11 | ||
| 15 | 1 | return { | client/pages/admin/components/statuses/Results.jsx | 13 |
| 16 | data: [] | client/pages/admin/components/statuses/Results.jsx | 14 | |
| 17 | }; | client/pages/admin/components/statuses/Results.jsx | 14 | |
| 18 | }, | client/pages/admin/components/statuses/Results.jsx | 15 | |
| 19 | render: function render() { | client/pages/admin/components/statuses/Results.jsx | 17 | |
| 20 | client/pages/admin/components/statuses/Results.jsx | 17 | ||
| 21 | 16 | var rows = this.props.data.map(function (record) { | client/pages/admin/components/statuses/Results.jsx | 19 |
| 22 | client/pages/admin/components/statuses/Results.jsx | 19 | ||
| 23 | 2 | return React.createElement( | client/pages/admin/components/statuses/Results.jsx | 21 |
| 24 | 'tr', | client/pages/admin/components/statuses/Results.jsx | 22 | |
| 25 | { key: record._id }, | client/pages/admin/components/statuses/Results.jsx | 22 | |
| 26 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 22 | |
| 27 | 'td', | client/pages/admin/components/statuses/Results.jsx | 23 | |
| 28 | null, | client/pages/admin/components/statuses/Results.jsx | 23 | |
| 29 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 23 | |
| 30 | Link, | client/pages/admin/components/statuses/Results.jsx | 24 | |
| 31 | { | client/pages/admin/components/statuses/Results.jsx | 24 | |
| 32 | className: 'btn btn-default btn-sm', | client/pages/admin/components/statuses/Results.jsx | 25 | |
| 33 | to: 'statusDetails', | client/pages/admin/components/statuses/Results.jsx | 26 | |
| 34 | params: { id: record._id } }, | client/pages/admin/components/statuses/Results.jsx | 27 | |
| 35 | 'Edit' | client/pages/admin/components/statuses/Results.jsx | 27 | |
| 36 | ) | client/pages/admin/components/statuses/Results.jsx | 27 | |
| 37 | ), | client/pages/admin/components/statuses/Results.jsx | 30 | |
| 38 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 31 | |
| 39 | 'td', | client/pages/admin/components/statuses/Results.jsx | 32 | |
| 40 | null, | client/pages/admin/components/statuses/Results.jsx | 32 | |
| 41 | record.pivot | client/pages/admin/components/statuses/Results.jsx | 32 | |
| 42 | ), | client/pages/admin/components/statuses/Results.jsx | 32 | |
| 43 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 32 | |
| 44 | 'td', | client/pages/admin/components/statuses/Results.jsx | 33 | |
| 45 | null, | client/pages/admin/components/statuses/Results.jsx | 33 | |
| 46 | record.name | client/pages/admin/components/statuses/Results.jsx | 33 | |
| 47 | ), | client/pages/admin/components/statuses/Results.jsx | 33 | |
| 48 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 33 | |
| 49 | 'td', | client/pages/admin/components/statuses/Results.jsx | 34 | |
| 50 | { className: 'nowrap' }, | client/pages/admin/components/statuses/Results.jsx | 34 | |
| 51 | record._id | client/pages/admin/components/statuses/Results.jsx | 34 | |
| 52 | ) | client/pages/admin/components/statuses/Results.jsx | 34 | |
| 53 | ); | client/pages/admin/components/statuses/Results.jsx | 34 | |
| 54 | }); | client/pages/admin/components/statuses/Results.jsx | 36 | |
| 55 | client/pages/admin/components/statuses/Results.jsx | 37 | ||
| 56 | 16 | return React.createElement( | client/pages/admin/components/statuses/Results.jsx | 39 |
| 57 | 'div', | client/pages/admin/components/statuses/Results.jsx | 40 | |
| 58 | { className: 'table-responsive' }, | client/pages/admin/components/statuses/Results.jsx | 40 | |
| 59 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 40 | |
| 60 | 'table', | client/pages/admin/components/statuses/Results.jsx | 41 | |
| 61 | { className: 'table table-striped table-results' }, | client/pages/admin/components/statuses/Results.jsx | 41 | |
| 62 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 41 | |
| 63 | 'thead', | client/pages/admin/components/statuses/Results.jsx | 42 | |
| 64 | null, | client/pages/admin/components/statuses/Results.jsx | 42 | |
| 65 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 42 | |
| 66 | 'tr', | client/pages/admin/components/statuses/Results.jsx | 43 | |
| 67 | null, | client/pages/admin/components/statuses/Results.jsx | 43 | |
| 68 | React.createElement('th', null), | client/pages/admin/components/statuses/Results.jsx | 43 | |
| 69 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 44 | |
| 70 | 'th', | client/pages/admin/components/statuses/Results.jsx | 45 | |
| 71 | null, | client/pages/admin/components/statuses/Results.jsx | 45 | |
| 72 | 'pivot' | client/pages/admin/components/statuses/Results.jsx | 45 | |
| 73 | ), | client/pages/admin/components/statuses/Results.jsx | 45 | |
| 74 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 45 | |
| 75 | 'th', | client/pages/admin/components/statuses/Results.jsx | 46 | |
| 76 | { className: 'stretch' }, | client/pages/admin/components/statuses/Results.jsx | 46 | |
| 77 | 'name' | client/pages/admin/components/statuses/Results.jsx | 46 | |
| 78 | ), | client/pages/admin/components/statuses/Results.jsx | 46 | |
| 79 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 46 | |
| 80 | 'th', | client/pages/admin/components/statuses/Results.jsx | 47 | |
| 81 | null, | client/pages/admin/components/statuses/Results.jsx | 47 | |
| 82 | 'id' | client/pages/admin/components/statuses/Results.jsx | 47 | |
| 83 | ) | client/pages/admin/components/statuses/Results.jsx | 47 | |
| 84 | ) | client/pages/admin/components/statuses/Results.jsx | 47 | |
| 85 | ), | client/pages/admin/components/statuses/Results.jsx | 48 | |
| 86 | React.createElement( | client/pages/admin/components/statuses/Results.jsx | 49 | |
| 87 | 'tbody', | client/pages/admin/components/statuses/Results.jsx | 50 | |
| 88 | null, | client/pages/admin/components/statuses/Results.jsx | 50 | |
| 89 | rows | client/pages/admin/components/statuses/Results.jsx | 50 | |
| 90 | ) | client/pages/admin/components/statuses/Results.jsx | 51 | |
| 91 | ) | client/pages/admin/components/statuses/Results.jsx | 52 | |
| 92 | ); | client/pages/admin/components/statuses/Results.jsx | 53 | |
| 93 | } | client/pages/admin/components/statuses/Results.jsx | 55 | |
| 94 | }); | client/pages/admin/components/statuses/Results.jsx | 56 | |
| 95 | client/pages/admin/components/statuses/Results.jsx | 57 | ||
| 96 | 1 | module.exports = Component; | client/pages/admin/components/statuses/Results.jsx | 60 |
| 97 | client/pages/admin/components/statuses/Results.jsx | 60 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/statuses/Search.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/statuses/Search.jsx | 2 | |
| 3 | client/pages/admin/components/statuses/Search.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/statuses/Search.jsx | 2 |
| 5 | 1 | var Paging = require('../../../../components/Paging'); | client/pages/admin/components/statuses/Search.jsx | 3 |
| 6 | 1 | var Actions = require('../../actions/Status'); | client/pages/admin/components/statuses/Search.jsx | 4 |
| 7 | 1 | var StatusStore = require('../../stores/Status'); | client/pages/admin/components/statuses/Search.jsx | 5 |
| 8 | 1 | var FilterForm = require('./FilterForm'); | client/pages/admin/components/statuses/Search.jsx | 6 |
| 9 | 1 | var CreateNewForm = require('./CreateNewForm'); | client/pages/admin/components/statuses/Search.jsx | 7 |
| 10 | 1 | var Results = require('./Results'); | client/pages/admin/components/statuses/Search.jsx | 8 |
| 11 | client/pages/admin/components/statuses/Search.jsx | 8 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/statuses/Search.jsx | 11 |
| 13 | displayName: 'Component', | client/pages/admin/components/statuses/Search.jsx | 11 | |
| 14 | client/pages/admin/components/statuses/Search.jsx | 11 | ||
| 15 | contextTypes: { | client/pages/admin/components/statuses/Search.jsx | 12 | |
| 16 | router: React.PropTypes.func | client/pages/admin/components/statuses/Search.jsx | 13 | |
| 17 | }, | client/pages/admin/components/statuses/Search.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/statuses/Search.jsx | 15 | |
| 19 | client/pages/admin/components/statuses/Search.jsx | 15 | ||
| 20 | 8 | StatusStore.resetResults(); | client/pages/admin/components/statuses/Search.jsx | 17 |
| 21 | 8 | StatusStore.resetCreateNew(); | client/pages/admin/components/statuses/Search.jsx | 18 |
| 22 | client/pages/admin/components/statuses/Search.jsx | 18 | ||
| 23 | 8 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/statuses/Search.jsx | 20 |
| 24 | client/pages/admin/components/statuses/Search.jsx | 20 | ||
| 25 | 8 | return { | client/pages/admin/components/statuses/Search.jsx | 22 |
| 26 | results: StatusStore.getResults(), | client/pages/admin/components/statuses/Search.jsx | 23 | |
| 27 | createNew: StatusStore.getCreateNew() | client/pages/admin/components/statuses/Search.jsx | 24 | |
| 28 | }; | client/pages/admin/components/statuses/Search.jsx | 24 | |
| 29 | }, | client/pages/admin/components/statuses/Search.jsx | 25 | |
| 30 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/statuses/Search.jsx | 27 | |
| 31 | client/pages/admin/components/statuses/Search.jsx | 27 | ||
| 32 | 1 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/statuses/Search.jsx | 29 |
| 33 | }, | client/pages/admin/components/statuses/Search.jsx | 29 | |
| 34 | componentDidMount: function componentDidMount() { | client/pages/admin/components/statuses/Search.jsx | 31 | |
| 35 | client/pages/admin/components/statuses/Search.jsx | 31 | ||
| 36 | 8 | StatusStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/statuses/Search.jsx | 33 |
| 37 | }, | client/pages/admin/components/statuses/Search.jsx | 33 | |
| 38 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/statuses/Search.jsx | 35 | |
| 39 | client/pages/admin/components/statuses/Search.jsx | 35 | ||
| 40 | 1 | StatusStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/statuses/Search.jsx | 37 |
| 41 | }, | client/pages/admin/components/statuses/Search.jsx | 37 | |
| 42 | onStoreChange: function onStoreChange() { | client/pages/admin/components/statuses/Search.jsx | 39 | |
| 43 | client/pages/admin/components/statuses/Search.jsx | 39 | ||
| 44 | 3 | this.setState({ | client/pages/admin/components/statuses/Search.jsx | 41 |
| 45 | results: StatusStore.getResults(), | client/pages/admin/components/statuses/Search.jsx | 42 | |
| 46 | createNew: StatusStore.getCreateNew() | client/pages/admin/components/statuses/Search.jsx | 43 | |
| 47 | }); | client/pages/admin/components/statuses/Search.jsx | 43 | |
| 48 | }, | client/pages/admin/components/statuses/Search.jsx | 44 | |
| 49 | onFiltersChange: function onFiltersChange(event) { | client/pages/admin/components/statuses/Search.jsx | 46 | |
| 50 | client/pages/admin/components/statuses/Search.jsx | 46 | ||
| 51 | 3 | if (event) { | client/pages/admin/components/statuses/Search.jsx | 48 |
| 52 | 1 | event.preventDefault(); | client/pages/admin/components/statuses/Search.jsx | 49 |
| 53 | 1 | event.stopPropagation(); | client/pages/admin/components/statuses/Search.jsx | 50 |
| 54 | } | client/pages/admin/components/statuses/Search.jsx | 50 | |
| 55 | client/pages/admin/components/statuses/Search.jsx | 51 | ||
| 56 | 3 | this.context.router.transitionTo('statuses', {}, this.refs.filters.state); | client/pages/admin/components/statuses/Search.jsx | 53 |
| 57 | 3 | window.scrollTo(0, 0); | client/pages/admin/components/statuses/Search.jsx | 54 |
| 58 | }, | client/pages/admin/components/statuses/Search.jsx | 54 | |
| 59 | onPageChange: function onPageChange(page) { | client/pages/admin/components/statuses/Search.jsx | 56 | |
| 60 | client/pages/admin/components/statuses/Search.jsx | 56 | ||
| 61 | 1 | this.refs.filters.changePage(page); | client/pages/admin/components/statuses/Search.jsx | 58 |
| 62 | }, | client/pages/admin/components/statuses/Search.jsx | 58 | |
| 63 | onNewClick: function onNewClick() { | client/pages/admin/components/statuses/Search.jsx | 60 | |
| 64 | client/pages/admin/components/statuses/Search.jsx | 60 | ||
| 65 | 1 | Actions.showCreateNew(); | client/pages/admin/components/statuses/Search.jsx | 62 |
| 66 | }, | client/pages/admin/components/statuses/Search.jsx | 62 | |
| 67 | render: function render() { | client/pages/admin/components/statuses/Search.jsx | 64 | |
| 68 | client/pages/admin/components/statuses/Search.jsx | 64 | ||
| 69 | 13 | return React.createElement( | client/pages/admin/components/statuses/Search.jsx | 66 |
| 70 | 'section', | client/pages/admin/components/statuses/Search.jsx | 67 | |
| 71 | { className: 'section-statuses container' }, | client/pages/admin/components/statuses/Search.jsx | 67 | |
| 72 | React.createElement( | client/pages/admin/components/statuses/Search.jsx | 67 | |
| 73 | 'div', | client/pages/admin/components/statuses/Search.jsx | 68 | |
| 74 | { className: 'page-header' }, | client/pages/admin/components/statuses/Search.jsx | 68 | |
| 75 | React.createElement( | client/pages/admin/components/statuses/Search.jsx | 68 | |
| 76 | 'button', | client/pages/admin/components/statuses/Search.jsx | 69 | |
| 77 | { | client/pages/admin/components/statuses/Search.jsx | 69 | |
| 78 | ref: 'createNew', | client/pages/admin/components/statuses/Search.jsx | 70 | |
| 79 | className: 'btn btn-default pull-right', | client/pages/admin/components/statuses/Search.jsx | 71 | |
| 80 | onClick: this.onNewClick }, | client/pages/admin/components/statuses/Search.jsx | 72 | |
| 81 | 'Create new' | client/pages/admin/components/statuses/Search.jsx | 72 | |
| 82 | ), | client/pages/admin/components/statuses/Search.jsx | 72 | |
| 83 | React.createElement( | client/pages/admin/components/statuses/Search.jsx | 75 | |
| 84 | 'h1', | client/pages/admin/components/statuses/Search.jsx | 76 | |
| 85 | null, | client/pages/admin/components/statuses/Search.jsx | 76 | |
| 86 | 'Statuses' | client/pages/admin/components/statuses/Search.jsx | 76 | |
| 87 | ) | client/pages/admin/components/statuses/Search.jsx | 76 | |
| 88 | ), | client/pages/admin/components/statuses/Search.jsx | 76 | |
| 89 | React.createElement(FilterForm, { | client/pages/admin/components/statuses/Search.jsx | 77 | |
| 90 | ref: 'filters', | client/pages/admin/components/statuses/Search.jsx | 79 | |
| 91 | query: this.context.router.getCurrentQuery(), | client/pages/admin/components/statuses/Search.jsx | 80 | |
| 92 | loading: this.state.results.loading, | client/pages/admin/components/statuses/Search.jsx | 81 | |
| 93 | onChange: this.onFiltersChange | client/pages/admin/components/statuses/Search.jsx | 82 | |
| 94 | }), | client/pages/admin/components/statuses/Search.jsx | 82 | |
| 95 | React.createElement(Results, { data: this.state.results.data }), | client/pages/admin/components/statuses/Search.jsx | 83 | |
| 96 | React.createElement(Paging, { | client/pages/admin/components/statuses/Search.jsx | 84 | |
| 97 | ref: 'paging', | client/pages/admin/components/statuses/Search.jsx | 86 | |
| 98 | pages: this.state.results.pages, | client/pages/admin/components/statuses/Search.jsx | 87 | |
| 99 | items: this.state.results.items, | client/pages/admin/components/statuses/Search.jsx | 88 | |
| 100 | loading: this.state.results.loading, | client/pages/admin/components/statuses/Search.jsx | 89 | |
| 101 | onChange: this.onPageChange | client/pages/admin/components/statuses/Search.jsx | 90 | |
| 102 | }), | client/pages/admin/components/statuses/Search.jsx | 90 | |
| 103 | React.createElement(CreateNewForm, { data: this.state.createNew }) | client/pages/admin/components/statuses/Search.jsx | 91 | |
| 104 | ); | client/pages/admin/components/statuses/Search.jsx | 92 | |
| 105 | } | client/pages/admin/components/statuses/Search.jsx | 94 | |
| 106 | }); | client/pages/admin/components/statuses/Search.jsx | 95 | |
| 107 | client/pages/admin/components/statuses/Search.jsx | 96 | ||
| 108 | 1 | module.exports = Component; | client/pages/admin/components/statuses/Search.jsx | 99 |
| 109 | client/pages/admin/components/statuses/Search.jsx | 99 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/users/CreateNewForm.jsx | 1 | |
| 2 | client/pages/admin/components/users/CreateNewForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/CreateNewForm.jsx | 1 |
| 4 | 1 | var Modal = require('../../../../components/Modal'); | client/pages/admin/components/users/CreateNewForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/users/CreateNewForm.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/users/CreateNewForm.jsx | 4 |
| 7 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/users/CreateNewForm.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/users/CreateNewForm.jsx | 6 |
| 9 | 1 | var Actions = require('../../actions/User'); | client/pages/admin/components/users/CreateNewForm.jsx | 7 |
| 10 | client/pages/admin/components/users/CreateNewForm.jsx | 7 | ||
| 11 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/users/CreateNewForm.jsx | 10 |
| 12 | client/pages/admin/components/users/CreateNewForm.jsx | 10 | ||
| 13 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/CreateNewForm.jsx | 13 |
| 14 | displayName: 'Component', | client/pages/admin/components/users/CreateNewForm.jsx | 13 | |
| 15 | client/pages/admin/components/users/CreateNewForm.jsx | 13 | ||
| 16 | mixins: [LinkedState], | client/pages/admin/components/users/CreateNewForm.jsx | 14 | |
| 17 | contextTypes: { | client/pages/admin/components/users/CreateNewForm.jsx | 15 | |
| 18 | router: React.PropTypes.func | client/pages/admin/components/users/CreateNewForm.jsx | 16 | |
| 19 | }, | client/pages/admin/components/users/CreateNewForm.jsx | 16 | |
| 20 | getInitialState: function getInitialState() { | client/pages/admin/components/users/CreateNewForm.jsx | 18 | |
| 21 | client/pages/admin/components/users/CreateNewForm.jsx | 18 | ||
| 22 | 15 | return {}; | client/pages/admin/components/users/CreateNewForm.jsx | 20 |
| 23 | }, | client/pages/admin/components/users/CreateNewForm.jsx | 20 | |
| 24 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/users/CreateNewForm.jsx | 22 | |
| 25 | client/pages/admin/components/users/CreateNewForm.jsx | 22 | ||
| 26 | 2 | clearTimeout(this.timeout); | client/pages/admin/components/users/CreateNewForm.jsx | 24 |
| 27 | }, | client/pages/admin/components/users/CreateNewForm.jsx | 24 | |
| 28 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/users/CreateNewForm.jsx | 26 | |
| 29 | client/pages/admin/components/users/CreateNewForm.jsx | 26 | ||
| 30 | 9 | if (!nextProps.data.show) { | client/pages/admin/components/users/CreateNewForm.jsx | 28 |
| 31 | 8 | this.replaceState({}); | client/pages/admin/components/users/CreateNewForm.jsx | 29 |
| 32 | } else { | client/pages/admin/components/users/CreateNewForm.jsx | 29 | |
| 33 | 1 | this.timeout = setTimeout((function () { | client/pages/admin/components/users/CreateNewForm.jsx | 32 |
| 34 | client/pages/admin/components/users/CreateNewForm.jsx | 32 | ||
| 35 | 1 | this.refs.username.refs.inputField.getDOMNode().focus(); | client/pages/admin/components/users/CreateNewForm.jsx | 34 |
| 36 | }).bind(this), 100); | client/pages/admin/components/users/CreateNewForm.jsx | 34 | |
| 37 | } | client/pages/admin/components/users/CreateNewForm.jsx | 35 | |
| 38 | }, | client/pages/admin/components/users/CreateNewForm.jsx | 36 | |
| 39 | onSubmit: function onSubmit(event) { | client/pages/admin/components/users/CreateNewForm.jsx | 38 | |
| 40 | client/pages/admin/components/users/CreateNewForm.jsx | 38 | ||
| 41 | 1 | event.preventDefault(); | client/pages/admin/components/users/CreateNewForm.jsx | 40 |
| 42 | 1 | event.stopPropagation(); | client/pages/admin/components/users/CreateNewForm.jsx | 41 |
| 43 | client/pages/admin/components/users/CreateNewForm.jsx | 41 | ||
| 44 | 1 | Actions.createNew({ | client/pages/admin/components/users/CreateNewForm.jsx | 43 |
| 45 | username: this.state.username, | client/pages/admin/components/users/CreateNewForm.jsx | 44 | |
| 46 | email: this.state.email, | client/pages/admin/components/users/CreateNewForm.jsx | 45 | |
| 47 | password: this.state.password | client/pages/admin/components/users/CreateNewForm.jsx | 46 | |
| 48 | }, this.context.router); | client/pages/admin/components/users/CreateNewForm.jsx | 46 | |
| 49 | }, | client/pages/admin/components/users/CreateNewForm.jsx | 47 | |
| 50 | render: function render() { | client/pages/admin/components/users/CreateNewForm.jsx | 49 | |
| 51 | client/pages/admin/components/users/CreateNewForm.jsx | 49 | ||
| 52 | 24 | var alerts; | client/pages/admin/components/users/CreateNewForm.jsx | 51 |
| 53 | 24 | if (this.props.data.error) { | client/pages/admin/components/users/CreateNewForm.jsx | 52 |
| 54 | 1 | alerts = React.createElement( | client/pages/admin/components/users/CreateNewForm.jsx | 53 |
| 55 | 'div', | client/pages/admin/components/users/CreateNewForm.jsx | 53 | |
| 56 | { className: 'alert alert-danger' }, | client/pages/admin/components/users/CreateNewForm.jsx | 53 | |
| 57 | this.props.data.error | client/pages/admin/components/users/CreateNewForm.jsx | 53 | |
| 58 | ); | client/pages/admin/components/users/CreateNewForm.jsx | 54 | |
| 59 | } | client/pages/admin/components/users/CreateNewForm.jsx | 55 | |
| 60 | client/pages/admin/components/users/CreateNewForm.jsx | 56 | ||
| 61 | 24 | var notice; | client/pages/admin/components/users/CreateNewForm.jsx | 58 |
| 62 | 24 | if (this.props.data.success) { | client/pages/admin/components/users/CreateNewForm.jsx | 59 |
| 63 | 1 | notice = React.createElement( | client/pages/admin/components/users/CreateNewForm.jsx | 60 |
| 64 | 'div', | client/pages/admin/components/users/CreateNewForm.jsx | 60 | |
| 65 | { className: 'alert alert-success' }, | client/pages/admin/components/users/CreateNewForm.jsx | 60 | |
| 66 | 'Loading data...' | client/pages/admin/components/users/CreateNewForm.jsx | 60 | |
| 67 | ); | client/pages/admin/components/users/CreateNewForm.jsx | 60 | |
| 68 | } | client/pages/admin/components/users/CreateNewForm.jsx | 62 | |
| 69 | client/pages/admin/components/users/CreateNewForm.jsx | 63 | ||
| 70 | 24 | var formElements; | client/pages/admin/components/users/CreateNewForm.jsx | 65 |
| 71 | 24 | if (!this.props.data.success) { | client/pages/admin/components/users/CreateNewForm.jsx | 66 |
| 72 | 23 | formElements = React.createElement( | client/pages/admin/components/users/CreateNewForm.jsx | 67 |
| 73 | 'fieldset', | client/pages/admin/components/users/CreateNewForm.jsx | 67 | |
| 74 | null, | client/pages/admin/components/users/CreateNewForm.jsx | 67 | |
| 75 | alerts, | client/pages/admin/components/users/CreateNewForm.jsx | 67 | |
| 76 | React.createElement(TextControl, { | client/pages/admin/components/users/CreateNewForm.jsx | 68 | |
| 77 | name: 'username', | client/pages/admin/components/users/CreateNewForm.jsx | 70 | |
| 78 | ref: 'username', | client/pages/admin/components/users/CreateNewForm.jsx | 71 | |
| 79 | label: 'Username', | client/pages/admin/components/users/CreateNewForm.jsx | 72 | |
| 80 | hasError: this.props.data.hasError.username, | client/pages/admin/components/users/CreateNewForm.jsx | 73 | |
| 81 | valueLink: this.linkState('username'), | client/pages/admin/components/users/CreateNewForm.jsx | 74 | |
| 82 | help: this.props.data.help.username, | client/pages/admin/components/users/CreateNewForm.jsx | 75 | |
| 83 | disabled: this.props.data.loading | client/pages/admin/components/users/CreateNewForm.jsx | 76 | |
| 84 | }), | client/pages/admin/components/users/CreateNewForm.jsx | 76 | |
| 85 | React.createElement(TextControl, { | client/pages/admin/components/users/CreateNewForm.jsx | 77 | |
| 86 | name: 'email', | client/pages/admin/components/users/CreateNewForm.jsx | 79 | |
| 87 | label: 'Email', | client/pages/admin/components/users/CreateNewForm.jsx | 80 | |
| 88 | hasError: this.props.data.hasError.email, | client/pages/admin/components/users/CreateNewForm.jsx | 81 | |
| 89 | valueLink: this.linkState('email'), | client/pages/admin/components/users/CreateNewForm.jsx | 82 | |
| 90 | help: this.props.data.help.email, | client/pages/admin/components/users/CreateNewForm.jsx | 83 | |
| 91 | disabled: this.props.data.loading | client/pages/admin/components/users/CreateNewForm.jsx | 84 | |
| 92 | }), | client/pages/admin/components/users/CreateNewForm.jsx | 84 | |
| 93 | React.createElement(TextControl, { | client/pages/admin/components/users/CreateNewForm.jsx | 85 | |
| 94 | name: 'password', | client/pages/admin/components/users/CreateNewForm.jsx | 87 | |
| 95 | label: 'Password', | client/pages/admin/components/users/CreateNewForm.jsx | 88 | |
| 96 | type: 'password', | client/pages/admin/components/users/CreateNewForm.jsx | 89 | |
| 97 | hasError: this.props.data.hasError.password, | client/pages/admin/components/users/CreateNewForm.jsx | 90 | |
| 98 | valueLink: this.linkState('password'), | client/pages/admin/components/users/CreateNewForm.jsx | 91 | |
| 99 | help: this.props.data.help.password, | client/pages/admin/components/users/CreateNewForm.jsx | 92 | |
| 100 | disabled: this.props.data.loading | client/pages/admin/components/users/CreateNewForm.jsx | 93 | |
| 101 | }), | client/pages/admin/components/users/CreateNewForm.jsx | 93 | |
| 102 | React.createElement( | client/pages/admin/components/users/CreateNewForm.jsx | 94 | |
| 103 | ControlGroup, | client/pages/admin/components/users/CreateNewForm.jsx | 95 | |
| 104 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/users/CreateNewForm.jsx | 95 | |
| 105 | React.createElement( | client/pages/admin/components/users/CreateNewForm.jsx | 95 | |
| 106 | Button, | client/pages/admin/components/users/CreateNewForm.jsx | 96 | |
| 107 | { | client/pages/admin/components/users/CreateNewForm.jsx | 96 | |
| 108 | type: 'submit', | client/pages/admin/components/users/CreateNewForm.jsx | 97 | |
| 109 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/users/CreateNewForm.jsx | 98 | |
| 110 | disabled: this.props.data.loading }, | client/pages/admin/components/users/CreateNewForm.jsx | 99 | |
| 111 | 'Create new', | client/pages/admin/components/users/CreateNewForm.jsx | 99 | |
| 112 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/users/CreateNewForm.jsx | 99 | |
| 113 | ) | client/pages/admin/components/users/CreateNewForm.jsx | 102 | |
| 114 | ) | client/pages/admin/components/users/CreateNewForm.jsx | 103 | |
| 115 | ); | client/pages/admin/components/users/CreateNewForm.jsx | 104 | |
| 116 | } | client/pages/admin/components/users/CreateNewForm.jsx | 105 | |
| 117 | client/pages/admin/components/users/CreateNewForm.jsx | 106 | ||
| 118 | 24 | return React.createElement( | client/pages/admin/components/users/CreateNewForm.jsx | 108 |
| 119 | Modal, | client/pages/admin/components/users/CreateNewForm.jsx | 109 | |
| 120 | { | client/pages/admin/components/users/CreateNewForm.jsx | 109 | |
| 121 | header: 'Create new', | client/pages/admin/components/users/CreateNewForm.jsx | 110 | |
| 122 | show: this.props.data.show, | client/pages/admin/components/users/CreateNewForm.jsx | 111 | |
| 123 | onClose: Actions.hideCreateNew }, | client/pages/admin/components/users/CreateNewForm.jsx | 112 | |
| 124 | React.createElement( | client/pages/admin/components/users/CreateNewForm.jsx | 112 | |
| 125 | 'form', | client/pages/admin/components/users/CreateNewForm.jsx | 114 | |
| 126 | { onSubmit: this.onSubmit }, | client/pages/admin/components/users/CreateNewForm.jsx | 114 | |
| 127 | notice, | client/pages/admin/components/users/CreateNewForm.jsx | 114 | |
| 128 | formElements | client/pages/admin/components/users/CreateNewForm.jsx | 115 | |
| 129 | ) | client/pages/admin/components/users/CreateNewForm.jsx | 116 | |
| 130 | ); | client/pages/admin/components/users/CreateNewForm.jsx | 117 | |
| 131 | } | client/pages/admin/components/users/CreateNewForm.jsx | 119 | |
| 132 | }); | client/pages/admin/components/users/CreateNewForm.jsx | 120 | |
| 133 | client/pages/admin/components/users/CreateNewForm.jsx | 121 | ||
| 134 | 1 | module.exports = Component; | client/pages/admin/components/users/CreateNewForm.jsx | 124 |
| 135 | client/pages/admin/components/users/CreateNewForm.jsx | 124 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/users/DeleteForm.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/users/DeleteForm.jsx | 2 | |
| 3 | client/pages/admin/components/users/DeleteForm.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/DeleteForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/users/DeleteForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/users/DeleteForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/users/DeleteForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/User'); | client/pages/admin/components/users/DeleteForm.jsx | 6 |
| 9 | client/pages/admin/components/users/DeleteForm.jsx | 6 | ||
| 10 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/users/DeleteForm.jsx | 9 |
| 11 | client/pages/admin/components/users/DeleteForm.jsx | 9 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/DeleteForm.jsx | 12 |
| 13 | displayName: 'Component', | client/pages/admin/components/users/DeleteForm.jsx | 12 | |
| 14 | client/pages/admin/components/users/DeleteForm.jsx | 12 | ||
| 15 | mixins: [LinkedState], | client/pages/admin/components/users/DeleteForm.jsx | 13 | |
| 16 | contextTypes: { | client/pages/admin/components/users/DeleteForm.jsx | 14 | |
| 17 | router: React.PropTypes.func | client/pages/admin/components/users/DeleteForm.jsx | 15 | |
| 18 | }, | client/pages/admin/components/users/DeleteForm.jsx | 15 | |
| 19 | getInitialState: function getInitialState() { | client/pages/admin/components/users/DeleteForm.jsx | 17 | |
| 20 | client/pages/admin/components/users/DeleteForm.jsx | 17 | ||
| 21 | 10 | return {}; | client/pages/admin/components/users/DeleteForm.jsx | 19 |
| 22 | }, | client/pages/admin/components/users/DeleteForm.jsx | 19 | |
| 23 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/users/DeleteForm.jsx | 21 | |
| 24 | client/pages/admin/components/users/DeleteForm.jsx | 21 | ||
| 25 | 1 | event.preventDefault(); | client/pages/admin/components/users/DeleteForm.jsx | 23 |
| 26 | 1 | event.stopPropagation(); | client/pages/admin/components/users/DeleteForm.jsx | 24 |
| 27 | client/pages/admin/components/users/DeleteForm.jsx | 24 | ||
| 28 | 1 | Actions['delete']({ | client/pages/admin/components/users/DeleteForm.jsx | 26 |
| 29 | id: this.props.details._id | client/pages/admin/components/users/DeleteForm.jsx | 27 | |
| 30 | }, this.context.router); | client/pages/admin/components/users/DeleteForm.jsx | 27 | |
| 31 | }, | client/pages/admin/components/users/DeleteForm.jsx | 28 | |
| 32 | onConfirm: function onConfirm(event) { | client/pages/admin/components/users/DeleteForm.jsx | 30 | |
| 33 | client/pages/admin/components/users/DeleteForm.jsx | 30 | ||
| 34 | 2 | if (!window.confirm('Are you sure?')) { | client/pages/admin/components/users/DeleteForm.jsx | 32 |
| 35 | 1 | event.preventDefault(); | client/pages/admin/components/users/DeleteForm.jsx | 33 |
| 36 | 1 | event.stopPropagation(); | client/pages/admin/components/users/DeleteForm.jsx | 34 |
| 37 | } | client/pages/admin/components/users/DeleteForm.jsx | 34 | |
| 38 | }, | client/pages/admin/components/users/DeleteForm.jsx | 35 | |
| 39 | render: function render() { | client/pages/admin/components/users/DeleteForm.jsx | 37 | |
| 40 | client/pages/admin/components/users/DeleteForm.jsx | 37 | ||
| 41 | 16 | var alerts; | client/pages/admin/components/users/DeleteForm.jsx | 39 |
| 42 | 16 | if (this.props.data.error) { | client/pages/admin/components/users/DeleteForm.jsx | 40 |
| 43 | 1 | alerts = React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 41 |
| 44 | 'div', | client/pages/admin/components/users/DeleteForm.jsx | 41 | |
| 45 | { className: 'alert alert-danger' }, | client/pages/admin/components/users/DeleteForm.jsx | 41 | |
| 46 | this.props.data.error | client/pages/admin/components/users/DeleteForm.jsx | 41 | |
| 47 | ); | client/pages/admin/components/users/DeleteForm.jsx | 42 | |
| 48 | } | client/pages/admin/components/users/DeleteForm.jsx | 43 | |
| 49 | client/pages/admin/components/users/DeleteForm.jsx | 44 | ||
| 50 | 16 | return React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 46 |
| 51 | 'form', | client/pages/admin/components/users/DeleteForm.jsx | 47 | |
| 52 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/users/DeleteForm.jsx | 47 | |
| 53 | React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 47 | |
| 54 | 'fieldset', | client/pages/admin/components/users/DeleteForm.jsx | 48 | |
| 55 | null, | client/pages/admin/components/users/DeleteForm.jsx | 48 | |
| 56 | React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 48 | |
| 57 | 'legend', | client/pages/admin/components/users/DeleteForm.jsx | 49 | |
| 58 | null, | client/pages/admin/components/users/DeleteForm.jsx | 49 | |
| 59 | 'Danger zone' | client/pages/admin/components/users/DeleteForm.jsx | 49 | |
| 60 | ), | client/pages/admin/components/users/DeleteForm.jsx | 49 | |
| 61 | React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 49 | |
| 62 | 'p', | client/pages/admin/components/users/DeleteForm.jsx | 50 | |
| 63 | null, | client/pages/admin/components/users/DeleteForm.jsx | 50 | |
| 64 | React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 50 | |
| 65 | 'span', | client/pages/admin/components/users/DeleteForm.jsx | 51 | |
| 66 | { className: 'label label-danger' }, | client/pages/admin/components/users/DeleteForm.jsx | 51 | |
| 67 | 'Warning' | client/pages/admin/components/users/DeleteForm.jsx | 51 | |
| 68 | ), | client/pages/admin/components/users/DeleteForm.jsx | 51 | |
| 69 | 'Â This cannot be undone and could result in orphaned document relationships.' | client/pages/admin/components/users/DeleteForm.jsx | 51 | |
| 70 | ), | client/pages/admin/components/users/DeleteForm.jsx | 51 | |
| 71 | alerts, | client/pages/admin/components/users/DeleteForm.jsx | 54 | |
| 72 | React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 55 | |
| 73 | ControlGroup, | client/pages/admin/components/users/DeleteForm.jsx | 56 | |
| 74 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/users/DeleteForm.jsx | 56 | |
| 75 | React.createElement( | client/pages/admin/components/users/DeleteForm.jsx | 56 | |
| 76 | Button, | client/pages/admin/components/users/DeleteForm.jsx | 57 | |
| 77 | { | client/pages/admin/components/users/DeleteForm.jsx | 57 | |
| 78 | type: 'submit', | client/pages/admin/components/users/DeleteForm.jsx | 58 | |
| 79 | inputClasses: { 'btn-danger': true }, | client/pages/admin/components/users/DeleteForm.jsx | 59 | |
| 80 | disabled: this.props.data.loading, | client/pages/admin/components/users/DeleteForm.jsx | 60 | |
| 81 | onClick: this.onConfirm }, | client/pages/admin/components/users/DeleteForm.jsx | 61 | |
| 82 | 'Delete', | client/pages/admin/components/users/DeleteForm.jsx | 61 | |
| 83 | React.createElement(Spinner, { | client/pages/admin/components/users/DeleteForm.jsx | 61 | |
| 84 | space: 'left', | client/pages/admin/components/users/DeleteForm.jsx | 65 | |
| 85 | show: this.props.data.loading | client/pages/admin/components/users/DeleteForm.jsx | 66 | |
| 86 | }) | client/pages/admin/components/users/DeleteForm.jsx | 66 | |
| 87 | ) | client/pages/admin/components/users/DeleteForm.jsx | 67 | |
| 88 | ) | client/pages/admin/components/users/DeleteForm.jsx | 68 | |
| 89 | ) | client/pages/admin/components/users/DeleteForm.jsx | 69 | |
| 90 | ); | client/pages/admin/components/users/DeleteForm.jsx | 70 | |
| 91 | } | client/pages/admin/components/users/DeleteForm.jsx | 72 | |
| 92 | }); | client/pages/admin/components/users/DeleteForm.jsx | 73 | |
| 93 | client/pages/admin/components/users/DeleteForm.jsx | 74 | ||
| 94 | 1 | module.exports = Component; | client/pages/admin/components/users/DeleteForm.jsx | 77 |
| 95 | client/pages/admin/components/users/DeleteForm.jsx | 77 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/users/Details.jsx | 1 | |
| 2 | client/pages/admin/components/users/Details.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/Details.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/users/Details.jsx | 2 |
| 5 | 1 | var IdentityForm = require('./IdentityForm'); | client/pages/admin/components/users/Details.jsx | 3 |
| 6 | 1 | var RolesForm = require('./RolesForm'); | client/pages/admin/components/users/Details.jsx | 4 |
| 7 | 1 | var PasswordForm = require('./PasswordForm'); | client/pages/admin/components/users/Details.jsx | 5 |
| 8 | 1 | var DeleteForm = require('./DeleteForm'); | client/pages/admin/components/users/Details.jsx | 6 |
| 9 | 1 | var UserStore = require('../../stores/User'); | client/pages/admin/components/users/Details.jsx | 7 |
| 10 | 1 | var Actions = require('../../actions/User'); | client/pages/admin/components/users/Details.jsx | 8 |
| 11 | client/pages/admin/components/users/Details.jsx | 8 | ||
| 12 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/users/Details.jsx | 11 |
| 13 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/users/Details.jsx | 12 |
| 14 | client/pages/admin/components/users/Details.jsx | 12 | ||
| 15 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/Details.jsx | 15 |
| 16 | displayName: 'Component', | client/pages/admin/components/users/Details.jsx | 15 | |
| 17 | client/pages/admin/components/users/Details.jsx | 15 | ||
| 18 | mixins: [LinkedState], | client/pages/admin/components/users/Details.jsx | 16 | |
| 19 | contextTypes: { | client/pages/admin/components/users/Details.jsx | 17 | |
| 20 | router: React.PropTypes.func | client/pages/admin/components/users/Details.jsx | 18 | |
| 21 | }, | client/pages/admin/components/users/Details.jsx | 18 | |
| 22 | getInitialState: function getInitialState() { | client/pages/admin/components/users/Details.jsx | 20 | |
| 23 | client/pages/admin/components/users/Details.jsx | 20 | ||
| 24 | 4 | UserStore.resetIdentity(); | client/pages/admin/components/users/Details.jsx | 22 |
| 25 | 4 | UserStore.resetPassword(); | client/pages/admin/components/users/Details.jsx | 23 |
| 26 | 4 | UserStore.resetDelete(); | client/pages/admin/components/users/Details.jsx | 24 |
| 27 | client/pages/admin/components/users/Details.jsx | 24 | ||
| 28 | 4 | Actions.getIdentity(this.context.router.getCurrentParams()); | client/pages/admin/components/users/Details.jsx | 26 |
| 29 | client/pages/admin/components/users/Details.jsx | 26 | ||
| 30 | 4 | return { | client/pages/admin/components/users/Details.jsx | 28 |
| 31 | identity: UserStore.getIdentity(), | client/pages/admin/components/users/Details.jsx | 29 | |
| 32 | password: UserStore.getPassword(), | client/pages/admin/components/users/Details.jsx | 30 | |
| 33 | 'delete': UserStore.getDelete() | client/pages/admin/components/users/Details.jsx | 31 | |
| 34 | }; | client/pages/admin/components/users/Details.jsx | 31 | |
| 35 | }, | client/pages/admin/components/users/Details.jsx | 32 | |
| 36 | componentDidMount: function componentDidMount() { | client/pages/admin/components/users/Details.jsx | 34 | |
| 37 | client/pages/admin/components/users/Details.jsx | 34 | ||
| 38 | 4 | UserStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/users/Details.jsx | 36 |
| 39 | }, | client/pages/admin/components/users/Details.jsx | 36 | |
| 40 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/users/Details.jsx | 38 | |
| 41 | client/pages/admin/components/users/Details.jsx | 38 | ||
| 42 | 1 | UserStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/users/Details.jsx | 40 |
| 43 | }, | client/pages/admin/components/users/Details.jsx | 40 | |
| 44 | onStoreChange: function onStoreChange() { | client/pages/admin/components/users/Details.jsx | 42 | |
| 45 | client/pages/admin/components/users/Details.jsx | 42 | ||
| 46 | 2 | this.setState({ | client/pages/admin/components/users/Details.jsx | 44 |
| 47 | identity: UserStore.getIdentity(), | client/pages/admin/components/users/Details.jsx | 45 | |
| 48 | password: UserStore.getPassword(), | client/pages/admin/components/users/Details.jsx | 46 | |
| 49 | 'delete': UserStore.getDelete() | client/pages/admin/components/users/Details.jsx | 47 | |
| 50 | }); | client/pages/admin/components/users/Details.jsx | 47 | |
| 51 | }, | client/pages/admin/components/users/Details.jsx | 48 | |
| 52 | render: function render() { | client/pages/admin/components/users/Details.jsx | 50 | |
| 53 | client/pages/admin/components/users/Details.jsx | 50 | ||
| 54 | 7 | if (this.state.identity.hydrated && this.state.identity.fetchFailure) { | client/pages/admin/components/users/Details.jsx | 52 |
| 55 | 1 | return React.createElement( | client/pages/admin/components/users/Details.jsx | 53 |
| 56 | 'section', | client/pages/admin/components/users/Details.jsx | 54 | |
| 57 | { className: 'section-user-details container' }, | client/pages/admin/components/users/Details.jsx | 54 | |
| 58 | React.createElement( | client/pages/admin/components/users/Details.jsx | 54 | |
| 59 | 'h1', | client/pages/admin/components/users/Details.jsx | 55 | |
| 60 | { className: 'page-header' }, | client/pages/admin/components/users/Details.jsx | 55 | |
| 61 | React.createElement( | client/pages/admin/components/users/Details.jsx | 55 | |
| 62 | Link, | client/pages/admin/components/users/Details.jsx | 56 | |
| 63 | { to: 'users' }, | client/pages/admin/components/users/Details.jsx | 56 | |
| 64 | 'Users' | client/pages/admin/components/users/Details.jsx | 56 | |
| 65 | ), | client/pages/admin/components/users/Details.jsx | 56 | |
| 66 | ' / Error' | client/pages/admin/components/users/Details.jsx | 56 | |
| 67 | ), | client/pages/admin/components/users/Details.jsx | 56 | |
| 68 | React.createElement( | client/pages/admin/components/users/Details.jsx | 57 | |
| 69 | 'div', | client/pages/admin/components/users/Details.jsx | 58 | |
| 70 | { className: 'alert alert-danger' }, | client/pages/admin/components/users/Details.jsx | 58 | |
| 71 | this.state.identity.error | client/pages/admin/components/users/Details.jsx | 58 | |
| 72 | ) | client/pages/admin/components/users/Details.jsx | 59 | |
| 73 | ); | client/pages/admin/components/users/Details.jsx | 60 | |
| 74 | } | client/pages/admin/components/users/Details.jsx | 62 | |
| 75 | client/pages/admin/components/users/Details.jsx | 63 | ||
| 76 | 6 | return React.createElement( | client/pages/admin/components/users/Details.jsx | 65 |
| 77 | 'section', | client/pages/admin/components/users/Details.jsx | 66 | |
| 78 | { className: 'section-user-details container' }, | client/pages/admin/components/users/Details.jsx | 66 | |
| 79 | React.createElement( | client/pages/admin/components/users/Details.jsx | 66 | |
| 80 | 'h1', | client/pages/admin/components/users/Details.jsx | 67 | |
| 81 | { className: 'page-header' }, | client/pages/admin/components/users/Details.jsx | 67 | |
| 82 | React.createElement( | client/pages/admin/components/users/Details.jsx | 67 | |
| 83 | Link, | client/pages/admin/components/users/Details.jsx | 68 | |
| 84 | { to: 'users' }, | client/pages/admin/components/users/Details.jsx | 68 | |
| 85 | 'Users' | client/pages/admin/components/users/Details.jsx | 68 | |
| 86 | ), | client/pages/admin/components/users/Details.jsx | 68 | |
| 87 | ' / ', | client/pages/admin/components/users/Details.jsx | 68 | |
| 88 | this.state.identity.username | client/pages/admin/components/users/Details.jsx | 68 | |
| 89 | ), | client/pages/admin/components/users/Details.jsx | 68 | |
| 90 | React.createElement( | client/pages/admin/components/users/Details.jsx | 69 | |
| 91 | 'div', | client/pages/admin/components/users/Details.jsx | 70 | |
| 92 | { className: 'row' }, | client/pages/admin/components/users/Details.jsx | 70 | |
| 93 | React.createElement( | client/pages/admin/components/users/Details.jsx | 70 | |
| 94 | 'div', | client/pages/admin/components/users/Details.jsx | 71 | |
| 95 | { className: 'col-sm-6' }, | client/pages/admin/components/users/Details.jsx | 71 | |
| 96 | React.createElement(IdentityForm, { data: this.state.identity }), | client/pages/admin/components/users/Details.jsx | 71 | |
| 97 | React.createElement(RolesForm, { data: this.state.identity }), | client/pages/admin/components/users/Details.jsx | 72 | |
| 98 | React.createElement(PasswordForm, { | client/pages/admin/components/users/Details.jsx | 73 | |
| 99 | data: this.state.password, | client/pages/admin/components/users/Details.jsx | 75 | |
| 100 | identity: this.state.identity | client/pages/admin/components/users/Details.jsx | 76 | |
| 101 | }), | client/pages/admin/components/users/Details.jsx | 76 | |
| 102 | React.createElement(DeleteForm, { | client/pages/admin/components/users/Details.jsx | 77 | |
| 103 | data: this.state['delete'], | client/pages/admin/components/users/Details.jsx | 79 | |
| 104 | details: this.state.identity | client/pages/admin/components/users/Details.jsx | 80 | |
| 105 | }) | client/pages/admin/components/users/Details.jsx | 80 | |
| 106 | ) | client/pages/admin/components/users/Details.jsx | 81 | |
| 107 | ) | client/pages/admin/components/users/Details.jsx | 82 | |
| 108 | ); | client/pages/admin/components/users/Details.jsx | 83 | |
| 109 | } | client/pages/admin/components/users/Details.jsx | 85 | |
| 110 | }); | client/pages/admin/components/users/Details.jsx | 86 | |
| 111 | client/pages/admin/components/users/Details.jsx | 87 | ||
| 112 | 1 | module.exports = Component; | client/pages/admin/components/users/Details.jsx | 90 |
| 113 | client/pages/admin/components/users/Details.jsx | 90 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/users/FilterForm.jsx | 1 | |
| 2 | client/pages/admin/components/users/FilterForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/FilterForm.jsx | 1 |
| 4 | 1 | var ObjectAssign = require('object-assign'); | client/pages/admin/components/users/FilterForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/users/FilterForm.jsx | 3 |
| 6 | 1 | var SelectControl = require('../../../../components/form/SelectControl'); | client/pages/admin/components/users/FilterForm.jsx | 4 |
| 7 | client/pages/admin/components/users/FilterForm.jsx | 4 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/FilterForm.jsx | 7 |
| 9 | displayName: 'Component', | client/pages/admin/components/users/FilterForm.jsx | 7 | |
| 10 | client/pages/admin/components/users/FilterForm.jsx | 7 | ||
| 11 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/users/FilterForm.jsx | 8 | |
| 12 | defaultState: { | client/pages/admin/components/users/FilterForm.jsx | 9 | |
| 13 | username: '', | client/pages/admin/components/users/FilterForm.jsx | 10 | |
| 14 | role: '', | client/pages/admin/components/users/FilterForm.jsx | 11 | |
| 15 | isActive: '', | client/pages/admin/components/users/FilterForm.jsx | 12 | |
| 16 | sort: '_id', | client/pages/admin/components/users/FilterForm.jsx | 13 | |
| 17 | limit: 20, | client/pages/admin/components/users/FilterForm.jsx | 14 | |
| 18 | page: 1 | client/pages/admin/components/users/FilterForm.jsx | 15 | |
| 19 | }, | client/pages/admin/components/users/FilterForm.jsx | 15 | |
| 20 | getInitialState: function getInitialState() { | client/pages/admin/components/users/FilterForm.jsx | 17 | |
| 21 | client/pages/admin/components/users/FilterForm.jsx | 17 | ||
| 22 | 14 | return ObjectAssign({}, this.defaultState, this.props.query); | client/pages/admin/components/users/FilterForm.jsx | 19 |
| 23 | }, | client/pages/admin/components/users/FilterForm.jsx | 19 | |
| 24 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/users/FilterForm.jsx | 21 | |
| 25 | client/pages/admin/components/users/FilterForm.jsx | 21 | ||
| 26 | 6 | var nextState = ObjectAssign({}, this.defaultState, nextProps.query); | client/pages/admin/components/users/FilterForm.jsx | 23 |
| 27 | 6 | this.setState(nextState); | client/pages/admin/components/users/FilterForm.jsx | 24 |
| 28 | }, | client/pages/admin/components/users/FilterForm.jsx | 24 | |
| 29 | onMenuChange: function onMenuChange(event) { | client/pages/admin/components/users/FilterForm.jsx | 26 | |
| 30 | client/pages/admin/components/users/FilterForm.jsx | 26 | ||
| 31 | 2 | var newState = { page: 1 }; | client/pages/admin/components/users/FilterForm.jsx | 28 |
| 32 | 2 | newState[event.target.name] = event.target.value; | client/pages/admin/components/users/FilterForm.jsx | 29 |
| 33 | 2 | this.setState(newState, this.props.onChange); | client/pages/admin/components/users/FilterForm.jsx | 30 |
| 34 | }, | client/pages/admin/components/users/FilterForm.jsx | 30 | |
| 35 | onEnterSubmit: function onEnterSubmit(event) { | client/pages/admin/components/users/FilterForm.jsx | 32 | |
| 36 | client/pages/admin/components/users/FilterForm.jsx | 32 | ||
| 37 | 2 | if (event.which === 13) { | client/pages/admin/components/users/FilterForm.jsx | 34 |
| 38 | 1 | event.preventDefault(); | client/pages/admin/components/users/FilterForm.jsx | 35 |
| 39 | 1 | event.stopPropagation(); | client/pages/admin/components/users/FilterForm.jsx | 36 |
| 40 | 1 | this.setState({ page: 1 }, this.props.onChange); | client/pages/admin/components/users/FilterForm.jsx | 37 |
| 41 | } | client/pages/admin/components/users/FilterForm.jsx | 37 | |
| 42 | }, | client/pages/admin/components/users/FilterForm.jsx | 38 | |
| 43 | changePage: function changePage(page) { | client/pages/admin/components/users/FilterForm.jsx | 40 | |
| 44 | client/pages/admin/components/users/FilterForm.jsx | 40 | ||
| 45 | 2 | this.setState({ page: page }, this.props.onChange); | client/pages/admin/components/users/FilterForm.jsx | 42 |
| 46 | }, | client/pages/admin/components/users/FilterForm.jsx | 42 | |
| 47 | render: function render() { | client/pages/admin/components/users/FilterForm.jsx | 44 | |
| 48 | client/pages/admin/components/users/FilterForm.jsx | 44 | ||
| 49 | 25 | return React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 46 |
| 50 | 'form', | client/pages/admin/components/users/FilterForm.jsx | 47 | |
| 51 | { onKeyDown: this.onEnterSubmit, onSubmit: this.props.onChange }, | client/pages/admin/components/users/FilterForm.jsx | 47 | |
| 52 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 47 | |
| 53 | 'div', | client/pages/admin/components/users/FilterForm.jsx | 48 | |
| 54 | { className: 'row' }, | client/pages/admin/components/users/FilterForm.jsx | 48 | |
| 55 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 48 | |
| 56 | 'div', | client/pages/admin/components/users/FilterForm.jsx | 49 | |
| 57 | { className: 'col-sm-3' }, | client/pages/admin/components/users/FilterForm.jsx | 49 | |
| 58 | React.createElement(TextControl, { | client/pages/admin/components/users/FilterForm.jsx | 49 | |
| 59 | name: 'username', | client/pages/admin/components/users/FilterForm.jsx | 51 | |
| 60 | label: 'Username search', | client/pages/admin/components/users/FilterForm.jsx | 52 | |
| 61 | valueLink: this.linkState('username'), | client/pages/admin/components/users/FilterForm.jsx | 53 | |
| 62 | disabled: this.props.loading | client/pages/admin/components/users/FilterForm.jsx | 54 | |
| 63 | }) | client/pages/admin/components/users/FilterForm.jsx | 54 | |
| 64 | ), | client/pages/admin/components/users/FilterForm.jsx | 55 | |
| 65 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 56 | |
| 66 | 'div', | client/pages/admin/components/users/FilterForm.jsx | 57 | |
| 67 | { className: 'col-sm-3' }, | client/pages/admin/components/users/FilterForm.jsx | 57 | |
| 68 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 57 | |
| 69 | SelectControl, | client/pages/admin/components/users/FilterForm.jsx | 58 | |
| 70 | { | client/pages/admin/components/users/FilterForm.jsx | 58 | |
| 71 | name: 'role', | client/pages/admin/components/users/FilterForm.jsx | 59 | |
| 72 | label: 'Can play role', | client/pages/admin/components/users/FilterForm.jsx | 60 | |
| 73 | disabled: this.props.loading, | client/pages/admin/components/users/FilterForm.jsx | 61 | |
| 74 | onChange: this.onMenuChange, | client/pages/admin/components/users/FilterForm.jsx | 62 | |
| 75 | value: this.state.role }, | client/pages/admin/components/users/FilterForm.jsx | 63 | |
| 76 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 63 | |
| 77 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 65 | |
| 78 | { value: '' }, | client/pages/admin/components/users/FilterForm.jsx | 65 | |
| 79 | '-- choose--' | client/pages/admin/components/users/FilterForm.jsx | 65 | |
| 80 | ), | client/pages/admin/components/users/FilterForm.jsx | 65 | |
| 81 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 65 | |
| 82 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 66 | |
| 83 | { value: 'admin' }, | client/pages/admin/components/users/FilterForm.jsx | 66 | |
| 84 | 'Admin' | client/pages/admin/components/users/FilterForm.jsx | 66 | |
| 85 | ), | client/pages/admin/components/users/FilterForm.jsx | 66 | |
| 86 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 66 | |
| 87 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 67 | |
| 88 | { value: 'account' }, | client/pages/admin/components/users/FilterForm.jsx | 67 | |
| 89 | 'Account' | client/pages/admin/components/users/FilterForm.jsx | 67 | |
| 90 | ) | client/pages/admin/components/users/FilterForm.jsx | 67 | |
| 91 | ) | client/pages/admin/components/users/FilterForm.jsx | 67 | |
| 92 | ), | client/pages/admin/components/users/FilterForm.jsx | 68 | |
| 93 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 69 | |
| 94 | 'div', | client/pages/admin/components/users/FilterForm.jsx | 70 | |
| 95 | { className: 'col-sm-2' }, | client/pages/admin/components/users/FilterForm.jsx | 70 | |
| 96 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 70 | |
| 97 | SelectControl, | client/pages/admin/components/users/FilterForm.jsx | 71 | |
| 98 | { | client/pages/admin/components/users/FilterForm.jsx | 71 | |
| 99 | name: 'isActive', | client/pages/admin/components/users/FilterForm.jsx | 72 | |
| 100 | label: 'Active', | client/pages/admin/components/users/FilterForm.jsx | 73 | |
| 101 | disabled: this.props.loading, | client/pages/admin/components/users/FilterForm.jsx | 74 | |
| 102 | onChange: this.onMenuChange, | client/pages/admin/components/users/FilterForm.jsx | 75 | |
| 103 | value: this.state.isActive }, | client/pages/admin/components/users/FilterForm.jsx | 76 | |
| 104 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 76 | |
| 105 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 78 | |
| 106 | { value: '' }, | client/pages/admin/components/users/FilterForm.jsx | 78 | |
| 107 | '-- choose--' | client/pages/admin/components/users/FilterForm.jsx | 78 | |
| 108 | ), | client/pages/admin/components/users/FilterForm.jsx | 78 | |
| 109 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 78 | |
| 110 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 79 | |
| 111 | { value: true }, | client/pages/admin/components/users/FilterForm.jsx | 79 | |
| 112 | 'true' | client/pages/admin/components/users/FilterForm.jsx | 79 | |
| 113 | ), | client/pages/admin/components/users/FilterForm.jsx | 79 | |
| 114 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 79 | |
| 115 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 80 | |
| 116 | { value: false }, | client/pages/admin/components/users/FilterForm.jsx | 80 | |
| 117 | 'false' | client/pages/admin/components/users/FilterForm.jsx | 80 | |
| 118 | ) | client/pages/admin/components/users/FilterForm.jsx | 80 | |
| 119 | ) | client/pages/admin/components/users/FilterForm.jsx | 80 | |
| 120 | ), | client/pages/admin/components/users/FilterForm.jsx | 81 | |
| 121 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 82 | |
| 122 | 'div', | client/pages/admin/components/users/FilterForm.jsx | 83 | |
| 123 | { className: 'col-sm-2' }, | client/pages/admin/components/users/FilterForm.jsx | 83 | |
| 124 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 83 | |
| 125 | SelectControl, | client/pages/admin/components/users/FilterForm.jsx | 84 | |
| 126 | { | client/pages/admin/components/users/FilterForm.jsx | 84 | |
| 127 | name: 'sort', | client/pages/admin/components/users/FilterForm.jsx | 85 | |
| 128 | label: 'Sort by', | client/pages/admin/components/users/FilterForm.jsx | 86 | |
| 129 | disabled: this.props.loading, | client/pages/admin/components/users/FilterForm.jsx | 87 | |
| 130 | onChange: this.onMenuChange, | client/pages/admin/components/users/FilterForm.jsx | 88 | |
| 131 | value: this.state.sort }, | client/pages/admin/components/users/FilterForm.jsx | 89 | |
| 132 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 89 | |
| 133 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 91 | |
| 134 | { value: '_id' }, | client/pages/admin/components/users/FilterForm.jsx | 91 | |
| 135 | 'id â–²' | client/pages/admin/components/users/FilterForm.jsx | 91 | |
| 136 | ), | client/pages/admin/components/users/FilterForm.jsx | 91 | |
| 137 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 91 | |
| 138 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 92 | |
| 139 | { value: '-_id' }, | client/pages/admin/components/users/FilterForm.jsx | 92 | |
| 140 | 'id â–¼' | client/pages/admin/components/users/FilterForm.jsx | 92 | |
| 141 | ), | client/pages/admin/components/users/FilterForm.jsx | 92 | |
| 142 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 92 | |
| 143 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 93 | |
| 144 | { value: 'username' }, | client/pages/admin/components/users/FilterForm.jsx | 93 | |
| 145 | 'username â–²' | client/pages/admin/components/users/FilterForm.jsx | 93 | |
| 146 | ), | client/pages/admin/components/users/FilterForm.jsx | 93 | |
| 147 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 93 | |
| 148 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 94 | |
| 149 | { value: '-username' }, | client/pages/admin/components/users/FilterForm.jsx | 94 | |
| 150 | 'username â–¼' | client/pages/admin/components/users/FilterForm.jsx | 94 | |
| 151 | ), | client/pages/admin/components/users/FilterForm.jsx | 94 | |
| 152 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 94 | |
| 153 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 95 | |
| 154 | { value: 'email' }, | client/pages/admin/components/users/FilterForm.jsx | 95 | |
| 155 | 'email â–²' | client/pages/admin/components/users/FilterForm.jsx | 95 | |
| 156 | ), | client/pages/admin/components/users/FilterForm.jsx | 95 | |
| 157 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 95 | |
| 158 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 96 | |
| 159 | { value: '-email' }, | client/pages/admin/components/users/FilterForm.jsx | 96 | |
| 160 | 'email â–¼' | client/pages/admin/components/users/FilterForm.jsx | 96 | |
| 161 | ) | client/pages/admin/components/users/FilterForm.jsx | 96 | |
| 162 | ) | client/pages/admin/components/users/FilterForm.jsx | 96 | |
| 163 | ), | client/pages/admin/components/users/FilterForm.jsx | 97 | |
| 164 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 98 | |
| 165 | 'div', | client/pages/admin/components/users/FilterForm.jsx | 99 | |
| 166 | { className: 'col-sm-2' }, | client/pages/admin/components/users/FilterForm.jsx | 99 | |
| 167 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 99 | |
| 168 | SelectControl, | client/pages/admin/components/users/FilterForm.jsx | 100 | |
| 169 | { | client/pages/admin/components/users/FilterForm.jsx | 100 | |
| 170 | name: 'limit', | client/pages/admin/components/users/FilterForm.jsx | 101 | |
| 171 | label: 'Limit', | client/pages/admin/components/users/FilterForm.jsx | 102 | |
| 172 | disabled: this.props.loading, | client/pages/admin/components/users/FilterForm.jsx | 103 | |
| 173 | onChange: this.onMenuChange, | client/pages/admin/components/users/FilterForm.jsx | 104 | |
| 174 | value: this.state.limit }, | client/pages/admin/components/users/FilterForm.jsx | 105 | |
| 175 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 105 | |
| 176 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 107 | |
| 177 | { value: 10 }, | client/pages/admin/components/users/FilterForm.jsx | 107 | |
| 178 | '10 items' | client/pages/admin/components/users/FilterForm.jsx | 107 | |
| 179 | ), | client/pages/admin/components/users/FilterForm.jsx | 107 | |
| 180 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 107 | |
| 181 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 108 | |
| 182 | { value: 20 }, | client/pages/admin/components/users/FilterForm.jsx | 108 | |
| 183 | '20 items' | client/pages/admin/components/users/FilterForm.jsx | 108 | |
| 184 | ), | client/pages/admin/components/users/FilterForm.jsx | 108 | |
| 185 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 108 | |
| 186 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 109 | |
| 187 | { value: 50 }, | client/pages/admin/components/users/FilterForm.jsx | 109 | |
| 188 | '50 items' | client/pages/admin/components/users/FilterForm.jsx | 109 | |
| 189 | ), | client/pages/admin/components/users/FilterForm.jsx | 109 | |
| 190 | React.createElement( | client/pages/admin/components/users/FilterForm.jsx | 109 | |
| 191 | 'option', | client/pages/admin/components/users/FilterForm.jsx | 110 | |
| 192 | { value: 100 }, | client/pages/admin/components/users/FilterForm.jsx | 110 | |
| 193 | '100 items' | client/pages/admin/components/users/FilterForm.jsx | 110 | |
| 194 | ) | client/pages/admin/components/users/FilterForm.jsx | 110 | |
| 195 | ) | client/pages/admin/components/users/FilterForm.jsx | 110 | |
| 196 | ) | client/pages/admin/components/users/FilterForm.jsx | 111 | |
| 197 | ) | client/pages/admin/components/users/FilterForm.jsx | 112 | |
| 198 | ); | client/pages/admin/components/users/FilterForm.jsx | 113 | |
| 199 | } | client/pages/admin/components/users/FilterForm.jsx | 115 | |
| 200 | }); | client/pages/admin/components/users/FilterForm.jsx | 116 | |
| 201 | client/pages/admin/components/users/FilterForm.jsx | 117 | ||
| 202 | 1 | module.exports = Component; | client/pages/admin/components/users/FilterForm.jsx | 120 |
| 203 | client/pages/admin/components/users/FilterForm.jsx | 120 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/users/IdentityForm.jsx | 1 | |
| 2 | client/pages/admin/components/users/IdentityForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/IdentityForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/users/IdentityForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/users/IdentityForm.jsx | 3 |
| 6 | 1 | var SelectControl = require('../../../../components/form/SelectControl'); | client/pages/admin/components/users/IdentityForm.jsx | 4 |
| 7 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/users/IdentityForm.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/users/IdentityForm.jsx | 6 |
| 9 | 1 | var Actions = require('../../actions/User'); | client/pages/admin/components/users/IdentityForm.jsx | 7 |
| 10 | client/pages/admin/components/users/IdentityForm.jsx | 7 | ||
| 11 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/IdentityForm.jsx | 10 |
| 12 | displayName: 'Component', | client/pages/admin/components/users/IdentityForm.jsx | 10 | |
| 13 | client/pages/admin/components/users/IdentityForm.jsx | 10 | ||
| 14 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/users/IdentityForm.jsx | 11 | |
| 15 | getInitialState: function getInitialState() { | client/pages/admin/components/users/IdentityForm.jsx | 12 | |
| 16 | client/pages/admin/components/users/IdentityForm.jsx | 12 | ||
| 17 | 10 | return {}; | client/pages/admin/components/users/IdentityForm.jsx | 14 |
| 18 | }, | client/pages/admin/components/users/IdentityForm.jsx | 14 | |
| 19 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/users/IdentityForm.jsx | 16 | |
| 20 | client/pages/admin/components/users/IdentityForm.jsx | 16 | ||
| 21 | 6 | if (!this.state.hydrated) { | client/pages/admin/components/users/IdentityForm.jsx | 18 |
| 22 | 5 | this.setState({ | client/pages/admin/components/users/IdentityForm.jsx | 19 |
| 23 | hydrated: nextProps.data.hydrated, | client/pages/admin/components/users/IdentityForm.jsx | 20 | |
| 24 | isActive: nextProps.data.isActive, | client/pages/admin/components/users/IdentityForm.jsx | 21 | |
| 25 | username: nextProps.data.username, | client/pages/admin/components/users/IdentityForm.jsx | 22 | |
| 26 | email: nextProps.data.email | client/pages/admin/components/users/IdentityForm.jsx | 23 | |
| 27 | }); | client/pages/admin/components/users/IdentityForm.jsx | 23 | |
| 28 | } | client/pages/admin/components/users/IdentityForm.jsx | 24 | |
| 29 | }, | client/pages/admin/components/users/IdentityForm.jsx | 25 | |
| 30 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/users/IdentityForm.jsx | 27 | |
| 31 | client/pages/admin/components/users/IdentityForm.jsx | 27 | ||
| 32 | 1 | event.preventDefault(); | client/pages/admin/components/users/IdentityForm.jsx | 29 |
| 33 | 1 | event.stopPropagation(); | client/pages/admin/components/users/IdentityForm.jsx | 30 |
| 34 | client/pages/admin/components/users/IdentityForm.jsx | 30 | ||
| 35 | 1 | Actions.saveIdentity({ | client/pages/admin/components/users/IdentityForm.jsx | 32 |
| 36 | id: this.props.data._id, | client/pages/admin/components/users/IdentityForm.jsx | 33 | |
| 37 | isActive: this.state.isActive, | client/pages/admin/components/users/IdentityForm.jsx | 34 | |
| 38 | username: this.state.username, | client/pages/admin/components/users/IdentityForm.jsx | 35 | |
| 39 | email: this.state.email | client/pages/admin/components/users/IdentityForm.jsx | 36 | |
| 40 | }); | client/pages/admin/components/users/IdentityForm.jsx | 36 | |
| 41 | }, | client/pages/admin/components/users/IdentityForm.jsx | 37 | |
| 42 | render: function render() { | client/pages/admin/components/users/IdentityForm.jsx | 39 | |
| 43 | client/pages/admin/components/users/IdentityForm.jsx | 39 | ||
| 44 | 16 | var alerts = []; | client/pages/admin/components/users/IdentityForm.jsx | 41 |
| 45 | 16 | if (this.props.data.success) { | client/pages/admin/components/users/IdentityForm.jsx | 42 |
| 46 | 1 | alerts.push(React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 43 |
| 47 | 'div', | client/pages/admin/components/users/IdentityForm.jsx | 43 | |
| 48 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/users/IdentityForm.jsx | 43 | |
| 49 | 'Success. Changes have been saved.' | client/pages/admin/components/users/IdentityForm.jsx | 43 | |
| 50 | )); | client/pages/admin/components/users/IdentityForm.jsx | 43 | |
| 51 | 15 | } else if (this.props.data.error) { | client/pages/admin/components/users/IdentityForm.jsx | 45 |
| 52 | 1 | alerts.push(React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 48 |
| 53 | 'div', | client/pages/admin/components/users/IdentityForm.jsx | 48 | |
| 54 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/users/IdentityForm.jsx | 48 | |
| 55 | this.props.data.error | client/pages/admin/components/users/IdentityForm.jsx | 48 | |
| 56 | )); | client/pages/admin/components/users/IdentityForm.jsx | 49 | |
| 57 | } | client/pages/admin/components/users/IdentityForm.jsx | 50 | |
| 58 | client/pages/admin/components/users/IdentityForm.jsx | 51 | ||
| 59 | 16 | var notice; | client/pages/admin/components/users/IdentityForm.jsx | 53 |
| 60 | 16 | if (!this.props.data.hydrated) { | client/pages/admin/components/users/IdentityForm.jsx | 54 |
| 61 | 12 | notice = React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 55 |
| 62 | 'div', | client/pages/admin/components/users/IdentityForm.jsx | 55 | |
| 63 | { className: 'alert alert-info' }, | client/pages/admin/components/users/IdentityForm.jsx | 55 | |
| 64 | 'Loading data...' | client/pages/admin/components/users/IdentityForm.jsx | 55 | |
| 65 | ); | client/pages/admin/components/users/IdentityForm.jsx | 55 | |
| 66 | } | client/pages/admin/components/users/IdentityForm.jsx | 57 | |
| 67 | client/pages/admin/components/users/IdentityForm.jsx | 58 | ||
| 68 | 16 | var formElements; | client/pages/admin/components/users/IdentityForm.jsx | 60 |
| 69 | 16 | if (this.props.data.hydrated) { | client/pages/admin/components/users/IdentityForm.jsx | 61 |
| 70 | 4 | formElements = React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 62 |
| 71 | 'fieldset', | client/pages/admin/components/users/IdentityForm.jsx | 62 | |
| 72 | null, | client/pages/admin/components/users/IdentityForm.jsx | 62 | |
| 73 | React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 62 | |
| 74 | 'legend', | client/pages/admin/components/users/IdentityForm.jsx | 63 | |
| 75 | null, | client/pages/admin/components/users/IdentityForm.jsx | 63 | |
| 76 | 'Identity' | client/pages/admin/components/users/IdentityForm.jsx | 63 | |
| 77 | ), | client/pages/admin/components/users/IdentityForm.jsx | 63 | |
| 78 | alerts, | client/pages/admin/components/users/IdentityForm.jsx | 63 | |
| 79 | React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 64 | |
| 80 | SelectControl, | client/pages/admin/components/users/IdentityForm.jsx | 65 | |
| 81 | { | client/pages/admin/components/users/IdentityForm.jsx | 65 | |
| 82 | name: 'isActive', | client/pages/admin/components/users/IdentityForm.jsx | 66 | |
| 83 | label: 'Active', | client/pages/admin/components/users/IdentityForm.jsx | 67 | |
| 84 | disabled: this.props.data.loading, | client/pages/admin/components/users/IdentityForm.jsx | 68 | |
| 85 | valueLink: this.linkState('isActive') }, | client/pages/admin/components/users/IdentityForm.jsx | 69 | |
| 86 | React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 69 | |
| 87 | 'option', | client/pages/admin/components/users/IdentityForm.jsx | 71 | |
| 88 | { value: true }, | client/pages/admin/components/users/IdentityForm.jsx | 71 | |
| 89 | 'true' | client/pages/admin/components/users/IdentityForm.jsx | 71 | |
| 90 | ), | client/pages/admin/components/users/IdentityForm.jsx | 71 | |
| 91 | React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 71 | |
| 92 | 'option', | client/pages/admin/components/users/IdentityForm.jsx | 72 | |
| 93 | { value: false }, | client/pages/admin/components/users/IdentityForm.jsx | 72 | |
| 94 | 'false' | client/pages/admin/components/users/IdentityForm.jsx | 72 | |
| 95 | ) | client/pages/admin/components/users/IdentityForm.jsx | 72 | |
| 96 | ), | client/pages/admin/components/users/IdentityForm.jsx | 72 | |
| 97 | React.createElement(TextControl, { | client/pages/admin/components/users/IdentityForm.jsx | 73 | |
| 98 | name: 'username', | client/pages/admin/components/users/IdentityForm.jsx | 75 | |
| 99 | label: 'Username', | client/pages/admin/components/users/IdentityForm.jsx | 76 | |
| 100 | hasError: this.props.data.hasError.username, | client/pages/admin/components/users/IdentityForm.jsx | 77 | |
| 101 | valueLink: this.linkState('username'), | client/pages/admin/components/users/IdentityForm.jsx | 78 | |
| 102 | help: this.props.data.help.username, | client/pages/admin/components/users/IdentityForm.jsx | 79 | |
| 103 | disabled: this.props.data.loading | client/pages/admin/components/users/IdentityForm.jsx | 80 | |
| 104 | }), | client/pages/admin/components/users/IdentityForm.jsx | 80 | |
| 105 | React.createElement(TextControl, { | client/pages/admin/components/users/IdentityForm.jsx | 81 | |
| 106 | name: 'email', | client/pages/admin/components/users/IdentityForm.jsx | 83 | |
| 107 | label: 'Email', | client/pages/admin/components/users/IdentityForm.jsx | 84 | |
| 108 | hasError: this.props.data.hasError.email, | client/pages/admin/components/users/IdentityForm.jsx | 85 | |
| 109 | valueLink: this.linkState('email'), | client/pages/admin/components/users/IdentityForm.jsx | 86 | |
| 110 | help: this.props.data.help.email, | client/pages/admin/components/users/IdentityForm.jsx | 87 | |
| 111 | disabled: this.props.data.loading | client/pages/admin/components/users/IdentityForm.jsx | 88 | |
| 112 | }), | client/pages/admin/components/users/IdentityForm.jsx | 88 | |
| 113 | React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 89 | |
| 114 | ControlGroup, | client/pages/admin/components/users/IdentityForm.jsx | 90 | |
| 115 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/users/IdentityForm.jsx | 90 | |
| 116 | React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 90 | |
| 117 | Button, | client/pages/admin/components/users/IdentityForm.jsx | 91 | |
| 118 | { | client/pages/admin/components/users/IdentityForm.jsx | 91 | |
| 119 | type: 'submit', | client/pages/admin/components/users/IdentityForm.jsx | 92 | |
| 120 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/users/IdentityForm.jsx | 93 | |
| 121 | disabled: this.props.data.loading }, | client/pages/admin/components/users/IdentityForm.jsx | 94 | |
| 122 | 'Save changes', | client/pages/admin/components/users/IdentityForm.jsx | 94 | |
| 123 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/users/IdentityForm.jsx | 94 | |
| 124 | ) | client/pages/admin/components/users/IdentityForm.jsx | 97 | |
| 125 | ) | client/pages/admin/components/users/IdentityForm.jsx | 98 | |
| 126 | ); | client/pages/admin/components/users/IdentityForm.jsx | 99 | |
| 127 | } | client/pages/admin/components/users/IdentityForm.jsx | 100 | |
| 128 | client/pages/admin/components/users/IdentityForm.jsx | 101 | ||
| 129 | 16 | return React.createElement( | client/pages/admin/components/users/IdentityForm.jsx | 103 |
| 130 | 'form', | client/pages/admin/components/users/IdentityForm.jsx | 104 | |
| 131 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/users/IdentityForm.jsx | 104 | |
| 132 | notice, | client/pages/admin/components/users/IdentityForm.jsx | 104 | |
| 133 | formElements | client/pages/admin/components/users/IdentityForm.jsx | 105 | |
| 134 | ); | client/pages/admin/components/users/IdentityForm.jsx | 106 | |
| 135 | } | client/pages/admin/components/users/IdentityForm.jsx | 108 | |
| 136 | }); | client/pages/admin/components/users/IdentityForm.jsx | 109 | |
| 137 | client/pages/admin/components/users/IdentityForm.jsx | 110 | ||
| 138 | 1 | module.exports = Component; | client/pages/admin/components/users/IdentityForm.jsx | 113 |
| 139 | client/pages/admin/components/users/IdentityForm.jsx | 113 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/users/PasswordForm.jsx | 1 | |
| 2 | client/pages/admin/components/users/PasswordForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/PasswordForm.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/users/PasswordForm.jsx | 2 |
| 5 | 1 | var TextControl = require('../../../../components/form/TextControl'); | client/pages/admin/components/users/PasswordForm.jsx | 3 |
| 6 | 1 | var Button = require('../../../../components/form/Button'); | client/pages/admin/components/users/PasswordForm.jsx | 4 |
| 7 | 1 | var Spinner = require('../../../../components/form/Spinner'); | client/pages/admin/components/users/PasswordForm.jsx | 5 |
| 8 | 1 | var Actions = require('../../actions/User'); | client/pages/admin/components/users/PasswordForm.jsx | 6 |
| 9 | client/pages/admin/components/users/PasswordForm.jsx | 6 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/PasswordForm.jsx | 9 |
| 11 | displayName: 'Component', | client/pages/admin/components/users/PasswordForm.jsx | 9 | |
| 12 | client/pages/admin/components/users/PasswordForm.jsx | 9 | ||
| 13 | mixins: [React.addons.LinkedStateMixin], | client/pages/admin/components/users/PasswordForm.jsx | 10 | |
| 14 | getInitialState: function getInitialState() { | client/pages/admin/components/users/PasswordForm.jsx | 11 | |
| 15 | client/pages/admin/components/users/PasswordForm.jsx | 11 | ||
| 16 | 10 | return {}; | client/pages/admin/components/users/PasswordForm.jsx | 13 |
| 17 | }, | client/pages/admin/components/users/PasswordForm.jsx | 13 | |
| 18 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/users/PasswordForm.jsx | 15 | |
| 19 | client/pages/admin/components/users/PasswordForm.jsx | 15 | ||
| 20 | 5 | if (!this.props.identity.hydrated) { | client/pages/admin/components/users/PasswordForm.jsx | 17 |
| 21 | 4 | this.replaceState({}); | client/pages/admin/components/users/PasswordForm.jsx | 18 |
| 22 | } | client/pages/admin/components/users/PasswordForm.jsx | 18 | |
| 23 | }, | client/pages/admin/components/users/PasswordForm.jsx | 19 | |
| 24 | handleSubmit: function handleSubmit(event) { | client/pages/admin/components/users/PasswordForm.jsx | 21 | |
| 25 | client/pages/admin/components/users/PasswordForm.jsx | 21 | ||
| 26 | 1 | event.preventDefault(); | client/pages/admin/components/users/PasswordForm.jsx | 23 |
| 27 | 1 | event.stopPropagation(); | client/pages/admin/components/users/PasswordForm.jsx | 24 |
| 28 | client/pages/admin/components/users/PasswordForm.jsx | 24 | ||
| 29 | 1 | Actions.savePassword({ | client/pages/admin/components/users/PasswordForm.jsx | 26 |
| 30 | id: this.props.identity._id, | client/pages/admin/components/users/PasswordForm.jsx | 27 | |
| 31 | password: this.state.password, | client/pages/admin/components/users/PasswordForm.jsx | 28 | |
| 32 | passwordConfirm: this.state.passwordConfirm | client/pages/admin/components/users/PasswordForm.jsx | 29 | |
| 33 | }); | client/pages/admin/components/users/PasswordForm.jsx | 29 | |
| 34 | }, | client/pages/admin/components/users/PasswordForm.jsx | 30 | |
| 35 | render: function render() { | client/pages/admin/components/users/PasswordForm.jsx | 32 | |
| 36 | client/pages/admin/components/users/PasswordForm.jsx | 32 | ||
| 37 | 15 | var alerts = []; | client/pages/admin/components/users/PasswordForm.jsx | 34 |
| 38 | 15 | if (this.props.data.success) { | client/pages/admin/components/users/PasswordForm.jsx | 35 |
| 39 | 1 | alerts.push(React.createElement( | client/pages/admin/components/users/PasswordForm.jsx | 36 |
| 40 | 'div', | client/pages/admin/components/users/PasswordForm.jsx | 36 | |
| 41 | { key: 'success', className: 'alert alert-success' }, | client/pages/admin/components/users/PasswordForm.jsx | 36 | |
| 42 | 'Success. Changes have been saved.' | client/pages/admin/components/users/PasswordForm.jsx | 36 | |
| 43 | )); | client/pages/admin/components/users/PasswordForm.jsx | 36 | |
| 44 | 14 | } else if (this.props.data.error) { | client/pages/admin/components/users/PasswordForm.jsx | 38 |
| 45 | 1 | alerts.push(React.createElement( | client/pages/admin/components/users/PasswordForm.jsx | 41 |
| 46 | 'div', | client/pages/admin/components/users/PasswordForm.jsx | 41 | |
| 47 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/admin/components/users/PasswordForm.jsx | 41 | |
| 48 | this.props.data.error | client/pages/admin/components/users/PasswordForm.jsx | 41 | |
| 49 | )); | client/pages/admin/components/users/PasswordForm.jsx | 42 | |
| 50 | } | client/pages/admin/components/users/PasswordForm.jsx | 43 | |
| 51 | client/pages/admin/components/users/PasswordForm.jsx | 44 | ||
| 52 | 15 | return React.createElement( | client/pages/admin/components/users/PasswordForm.jsx | 46 |
| 53 | 'form', | client/pages/admin/components/users/PasswordForm.jsx | 47 | |
| 54 | { onSubmit: this.handleSubmit }, | client/pages/admin/components/users/PasswordForm.jsx | 47 | |
| 55 | React.createElement( | client/pages/admin/components/users/PasswordForm.jsx | 47 | |
| 56 | 'fieldset', | client/pages/admin/components/users/PasswordForm.jsx | 48 | |
| 57 | null, | client/pages/admin/components/users/PasswordForm.jsx | 48 | |
| 58 | React.createElement( | client/pages/admin/components/users/PasswordForm.jsx | 48 | |
| 59 | 'legend', | client/pages/admin/components/users/PasswordForm.jsx | 49 | |
| 60 | null, | client/pages/admin/components/users/PasswordForm.jsx | 49 | |
| 61 | 'Password' | client/pages/admin/components/users/PasswordForm.jsx | 49 | |
| 62 | ), | client/pages/admin/components/users/PasswordForm.jsx | 49 | |
| 63 | alerts, | client/pages/admin/components/users/PasswordForm.jsx | 49 | |
| 64 | React.createElement(TextControl, { | client/pages/admin/components/users/PasswordForm.jsx | 50 | |
| 65 | name: 'password', | client/pages/admin/components/users/PasswordForm.jsx | 52 | |
| 66 | label: 'New password', | client/pages/admin/components/users/PasswordForm.jsx | 53 | |
| 67 | type: 'password', | client/pages/admin/components/users/PasswordForm.jsx | 54 | |
| 68 | hasError: this.props.data.hasError.password, | client/pages/admin/components/users/PasswordForm.jsx | 55 | |
| 69 | valueLink: this.linkState('password'), | client/pages/admin/components/users/PasswordForm.jsx | 56 | |
| 70 | help: this.props.data.help.password, | client/pages/admin/components/users/PasswordForm.jsx | 57 | |
| 71 | disabled: this.props.data.loading | client/pages/admin/components/users/PasswordForm.jsx | 58 | |
| 72 | }), | client/pages/admin/components/users/PasswordForm.jsx | 58 | |
| 73 | React.createElement(TextControl, { | client/pages/admin/components/users/PasswordForm.jsx | 59 | |
| 74 | name: 'passwordConfirm', | client/pages/admin/components/users/PasswordForm.jsx | 61 | |
| 75 | label: 'Confirm new password', | client/pages/admin/components/users/PasswordForm.jsx | 62 | |
| 76 | type: 'password', | client/pages/admin/components/users/PasswordForm.jsx | 63 | |
| 77 | hasError: this.props.data.hasError.passwordConfirm, | client/pages/admin/components/users/PasswordForm.jsx | 64 | |
| 78 | valueLink: this.linkState('passwordConfirm'), | client/pages/admin/components/users/PasswordForm.jsx | 65 | |
| 79 | help: this.props.data.help.passwordConfirm, | client/pages/admin/components/users/PasswordForm.jsx | 66 | |
| 80 | disabled: this.props.data.loading | client/pages/admin/components/users/PasswordForm.jsx | 67 | |
| 81 | }), | client/pages/admin/components/users/PasswordForm.jsx | 67 | |
| 82 | React.createElement( | client/pages/admin/components/users/PasswordForm.jsx | 68 | |
| 83 | ControlGroup, | client/pages/admin/components/users/PasswordForm.jsx | 69 | |
| 84 | { hideLabel: true, hideHelp: true }, | client/pages/admin/components/users/PasswordForm.jsx | 69 | |
| 85 | React.createElement( | client/pages/admin/components/users/PasswordForm.jsx | 69 | |
| 86 | Button, | client/pages/admin/components/users/PasswordForm.jsx | 70 | |
| 87 | { | client/pages/admin/components/users/PasswordForm.jsx | 70 | |
| 88 | type: 'submit', | client/pages/admin/components/users/PasswordForm.jsx | 71 | |
| 89 | inputClasses: { 'btn-primary': true }, | client/pages/admin/components/users/PasswordForm.jsx | 72 | |
| 90 | disabled: this.props.data.loading }, | client/pages/admin/components/users/PasswordForm.jsx | 73 | |
| 91 | 'Set password', | client/pages/admin/components/users/PasswordForm.jsx | 73 | |
| 92 | React.createElement(Spinner, { space: 'left', show: this.props.data.loading }) | client/pages/admin/components/users/PasswordForm.jsx | 73 | |
| 93 | ) | client/pages/admin/components/users/PasswordForm.jsx | 76 | |
| 94 | ) | client/pages/admin/components/users/PasswordForm.jsx | 77 | |
| 95 | ) | client/pages/admin/components/users/PasswordForm.jsx | 78 | |
| 96 | ); | client/pages/admin/components/users/PasswordForm.jsx | 79 | |
| 97 | } | client/pages/admin/components/users/PasswordForm.jsx | 81 | |
| 98 | }); | client/pages/admin/components/users/PasswordForm.jsx | 82 | |
| 99 | client/pages/admin/components/users/PasswordForm.jsx | 83 | ||
| 100 | 1 | module.exports = Component; | client/pages/admin/components/users/PasswordForm.jsx | 86 |
| 101 | client/pages/admin/components/users/PasswordForm.jsx | 86 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/users/Results.jsx | 1 | |
| 2 | client/pages/admin/components/users/Results.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/Results.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/users/Results.jsx | 2 |
| 5 | client/pages/admin/components/users/Results.jsx | 2 | ||
| 6 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/users/Results.jsx | 5 |
| 7 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/users/Results.jsx | 6 |
| 8 | client/pages/admin/components/users/Results.jsx | 6 | ||
| 9 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/Results.jsx | 9 |
| 10 | displayName: 'Component', | client/pages/admin/components/users/Results.jsx | 9 | |
| 11 | client/pages/admin/components/users/Results.jsx | 9 | ||
| 12 | mixins: [LinkedState], | client/pages/admin/components/users/Results.jsx | 10 | |
| 13 | getDefaultProps: function getDefaultProps() { | client/pages/admin/components/users/Results.jsx | 11 | |
| 14 | client/pages/admin/components/users/Results.jsx | 11 | ||
| 15 | 1 | return { | client/pages/admin/components/users/Results.jsx | 13 |
| 16 | data: [] | client/pages/admin/components/users/Results.jsx | 14 | |
| 17 | }; | client/pages/admin/components/users/Results.jsx | 14 | |
| 18 | }, | client/pages/admin/components/users/Results.jsx | 15 | |
| 19 | render: function render() { | client/pages/admin/components/users/Results.jsx | 17 | |
| 20 | client/pages/admin/components/users/Results.jsx | 17 | ||
| 21 | 16 | var rows = this.props.data.map(function (record) { | client/pages/admin/components/users/Results.jsx | 19 |
| 22 | client/pages/admin/components/users/Results.jsx | 19 | ||
| 23 | 2 | return React.createElement( | client/pages/admin/components/users/Results.jsx | 21 |
| 24 | 'tr', | client/pages/admin/components/users/Results.jsx | 22 | |
| 25 | { key: record._id }, | client/pages/admin/components/users/Results.jsx | 22 | |
| 26 | React.createElement( | client/pages/admin/components/users/Results.jsx | 22 | |
| 27 | 'td', | client/pages/admin/components/users/Results.jsx | 23 | |
| 28 | null, | client/pages/admin/components/users/Results.jsx | 23 | |
| 29 | React.createElement( | client/pages/admin/components/users/Results.jsx | 23 | |
| 30 | Link, | client/pages/admin/components/users/Results.jsx | 24 | |
| 31 | { | client/pages/admin/components/users/Results.jsx | 24 | |
| 32 | className: 'btn btn-default btn-sm', | client/pages/admin/components/users/Results.jsx | 25 | |
| 33 | to: 'userDetails', | client/pages/admin/components/users/Results.jsx | 26 | |
| 34 | params: { id: record._id } }, | client/pages/admin/components/users/Results.jsx | 27 | |
| 35 | 'Edit' | client/pages/admin/components/users/Results.jsx | 27 | |
| 36 | ) | client/pages/admin/components/users/Results.jsx | 27 | |
| 37 | ), | client/pages/admin/components/users/Results.jsx | 30 | |
| 38 | React.createElement( | client/pages/admin/components/users/Results.jsx | 31 | |
| 39 | 'td', | client/pages/admin/components/users/Results.jsx | 32 | |
| 40 | null, | client/pages/admin/components/users/Results.jsx | 32 | |
| 41 | record.username | client/pages/admin/components/users/Results.jsx | 32 | |
| 42 | ), | client/pages/admin/components/users/Results.jsx | 32 | |
| 43 | React.createElement( | client/pages/admin/components/users/Results.jsx | 32 | |
| 44 | 'td', | client/pages/admin/components/users/Results.jsx | 33 | |
| 45 | null, | client/pages/admin/components/users/Results.jsx | 33 | |
| 46 | record.email | client/pages/admin/components/users/Results.jsx | 33 | |
| 47 | ), | client/pages/admin/components/users/Results.jsx | 33 | |
| 48 | React.createElement( | client/pages/admin/components/users/Results.jsx | 33 | |
| 49 | 'td', | client/pages/admin/components/users/Results.jsx | 34 | |
| 50 | null, | client/pages/admin/components/users/Results.jsx | 34 | |
| 51 | record.isActive.toString() | client/pages/admin/components/users/Results.jsx | 34 | |
| 52 | ), | client/pages/admin/components/users/Results.jsx | 34 | |
| 53 | React.createElement( | client/pages/admin/components/users/Results.jsx | 34 | |
| 54 | 'td', | client/pages/admin/components/users/Results.jsx | 35 | |
| 55 | null, | client/pages/admin/components/users/Results.jsx | 35 | |
| 56 | record._id | client/pages/admin/components/users/Results.jsx | 35 | |
| 57 | ) | client/pages/admin/components/users/Results.jsx | 35 | |
| 58 | ); | client/pages/admin/components/users/Results.jsx | 35 | |
| 59 | }); | client/pages/admin/components/users/Results.jsx | 37 | |
| 60 | client/pages/admin/components/users/Results.jsx | 38 | ||
| 61 | 16 | return React.createElement( | client/pages/admin/components/users/Results.jsx | 40 |
| 62 | 'div', | client/pages/admin/components/users/Results.jsx | 41 | |
| 63 | { className: 'table-responsive' }, | client/pages/admin/components/users/Results.jsx | 41 | |
| 64 | React.createElement( | client/pages/admin/components/users/Results.jsx | 41 | |
| 65 | 'table', | client/pages/admin/components/users/Results.jsx | 42 | |
| 66 | { className: 'table table-striped table-results' }, | client/pages/admin/components/users/Results.jsx | 42 | |
| 67 | React.createElement( | client/pages/admin/components/users/Results.jsx | 42 | |
| 68 | 'thead', | client/pages/admin/components/users/Results.jsx | 43 | |
| 69 | null, | client/pages/admin/components/users/Results.jsx | 43 | |
| 70 | React.createElement( | client/pages/admin/components/users/Results.jsx | 43 | |
| 71 | 'tr', | client/pages/admin/components/users/Results.jsx | 44 | |
| 72 | null, | client/pages/admin/components/users/Results.jsx | 44 | |
| 73 | React.createElement('th', null), | client/pages/admin/components/users/Results.jsx | 44 | |
| 74 | React.createElement( | client/pages/admin/components/users/Results.jsx | 45 | |
| 75 | 'th', | client/pages/admin/components/users/Results.jsx | 46 | |
| 76 | null, | client/pages/admin/components/users/Results.jsx | 46 | |
| 77 | 'username' | client/pages/admin/components/users/Results.jsx | 46 | |
| 78 | ), | client/pages/admin/components/users/Results.jsx | 46 | |
| 79 | React.createElement( | client/pages/admin/components/users/Results.jsx | 46 | |
| 80 | 'th', | client/pages/admin/components/users/Results.jsx | 47 | |
| 81 | { className: 'stretch' }, | client/pages/admin/components/users/Results.jsx | 47 | |
| 82 | 'email' | client/pages/admin/components/users/Results.jsx | 47 | |
| 83 | ), | client/pages/admin/components/users/Results.jsx | 47 | |
| 84 | React.createElement( | client/pages/admin/components/users/Results.jsx | 47 | |
| 85 | 'th', | client/pages/admin/components/users/Results.jsx | 48 | |
| 86 | null, | client/pages/admin/components/users/Results.jsx | 48 | |
| 87 | 'active' | client/pages/admin/components/users/Results.jsx | 48 | |
| 88 | ), | client/pages/admin/components/users/Results.jsx | 48 | |
| 89 | React.createElement( | client/pages/admin/components/users/Results.jsx | 48 | |
| 90 | 'th', | client/pages/admin/components/users/Results.jsx | 49 | |
| 91 | null, | client/pages/admin/components/users/Results.jsx | 49 | |
| 92 | 'id' | client/pages/admin/components/users/Results.jsx | 49 | |
| 93 | ) | client/pages/admin/components/users/Results.jsx | 49 | |
| 94 | ) | client/pages/admin/components/users/Results.jsx | 49 | |
| 95 | ), | client/pages/admin/components/users/Results.jsx | 50 | |
| 96 | React.createElement( | client/pages/admin/components/users/Results.jsx | 51 | |
| 97 | 'tbody', | client/pages/admin/components/users/Results.jsx | 52 | |
| 98 | null, | client/pages/admin/components/users/Results.jsx | 52 | |
| 99 | rows | client/pages/admin/components/users/Results.jsx | 52 | |
| 100 | ) | client/pages/admin/components/users/Results.jsx | 53 | |
| 101 | ) | client/pages/admin/components/users/Results.jsx | 54 | |
| 102 | ); | client/pages/admin/components/users/Results.jsx | 55 | |
| 103 | } | client/pages/admin/components/users/Results.jsx | 57 | |
| 104 | }); | client/pages/admin/components/users/Results.jsx | 58 | |
| 105 | client/pages/admin/components/users/Results.jsx | 59 | ||
| 106 | 1 | module.exports = Component; | client/pages/admin/components/users/Results.jsx | 62 |
| 107 | client/pages/admin/components/users/Results.jsx | 62 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/admin/components/users/RolesForm.jsx | 1 | |
| 2 | client/pages/admin/components/users/RolesForm.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/RolesForm.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/admin/components/users/RolesForm.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../../components/form/ControlGroup'); | client/pages/admin/components/users/RolesForm.jsx | 3 |
| 6 | client/pages/admin/components/users/RolesForm.jsx | 3 | ||
| 7 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/admin/components/users/RolesForm.jsx | 6 |
| 8 | 1 | var Link = ReactRouter.Link; | client/pages/admin/components/users/RolesForm.jsx | 7 |
| 9 | client/pages/admin/components/users/RolesForm.jsx | 7 | ||
| 10 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/RolesForm.jsx | 10 |
| 11 | displayName: 'Component', | client/pages/admin/components/users/RolesForm.jsx | 10 | |
| 12 | client/pages/admin/components/users/RolesForm.jsx | 10 | ||
| 13 | mixins: [LinkedState], | client/pages/admin/components/users/RolesForm.jsx | 11 | |
| 14 | render: function render() { | client/pages/admin/components/users/RolesForm.jsx | 12 | |
| 15 | client/pages/admin/components/users/RolesForm.jsx | 12 | ||
| 16 | 10 | var notice; | client/pages/admin/components/users/RolesForm.jsx | 14 |
| 17 | 10 | if (!this.props.data.hydrated) { | client/pages/admin/components/users/RolesForm.jsx | 15 |
| 18 | 8 | notice = React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 16 |
| 19 | 'div', | client/pages/admin/components/users/RolesForm.jsx | 16 | |
| 20 | { className: 'alert alert-info' }, | client/pages/admin/components/users/RolesForm.jsx | 16 | |
| 21 | 'Loading data...' | client/pages/admin/components/users/RolesForm.jsx | 16 | |
| 22 | ); | client/pages/admin/components/users/RolesForm.jsx | 16 | |
| 23 | } | client/pages/admin/components/users/RolesForm.jsx | 18 | |
| 24 | client/pages/admin/components/users/RolesForm.jsx | 19 | ||
| 25 | 10 | var formElements; | client/pages/admin/components/users/RolesForm.jsx | 21 |
| 26 | 10 | if (this.props.data.hydrated) { | client/pages/admin/components/users/RolesForm.jsx | 22 |
| 27 | 2 | var roles = this.props.data.roles || {}; | client/pages/admin/components/users/RolesForm.jsx | 23 |
| 28 | 2 | var rolesUi = []; | client/pages/admin/components/users/RolesForm.jsx | 24 |
| 29 | client/pages/admin/components/users/RolesForm.jsx | 24 | ||
| 30 | 2 | if (roles.account) { | client/pages/admin/components/users/RolesForm.jsx | 26 |
| 31 | 1 | rolesUi.push(React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 27 |
| 32 | ControlGroup, | client/pages/admin/components/users/RolesForm.jsx | 28 | |
| 33 | { key: 'account', label: 'Account', hideHelp: true }, | client/pages/admin/components/users/RolesForm.jsx | 28 | |
| 34 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 28 | |
| 35 | 'div', | client/pages/admin/components/users/RolesForm.jsx | 29 | |
| 36 | { className: 'input-group' }, | client/pages/admin/components/users/RolesForm.jsx | 29 | |
| 37 | React.createElement('input', { | client/pages/admin/components/users/RolesForm.jsx | 29 | |
| 38 | type: 'text', | client/pages/admin/components/users/RolesForm.jsx | 31 | |
| 39 | className: 'form-control', | client/pages/admin/components/users/RolesForm.jsx | 32 | |
| 40 | disabled: true, | client/pages/admin/components/users/RolesForm.jsx | 33 | |
| 41 | value: roles.account.name | client/pages/admin/components/users/RolesForm.jsx | 34 | |
| 42 | }), | client/pages/admin/components/users/RolesForm.jsx | 34 | |
| 43 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 35 | |
| 44 | 'span', | client/pages/admin/components/users/RolesForm.jsx | 36 | |
| 45 | { className: 'input-group-btn' }, | client/pages/admin/components/users/RolesForm.jsx | 36 | |
| 46 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 36 | |
| 47 | Link, | client/pages/admin/components/users/RolesForm.jsx | 37 | |
| 48 | { | client/pages/admin/components/users/RolesForm.jsx | 37 | |
| 49 | to: 'accountDetails', | client/pages/admin/components/users/RolesForm.jsx | 38 | |
| 50 | params: { id: roles.account.id }, | client/pages/admin/components/users/RolesForm.jsx | 39 | |
| 51 | className: 'btn btn-default' }, | client/pages/admin/components/users/RolesForm.jsx | 40 | |
| 52 | 'View' | client/pages/admin/components/users/RolesForm.jsx | 40 | |
| 53 | ) | client/pages/admin/components/users/RolesForm.jsx | 40 | |
| 54 | ) | client/pages/admin/components/users/RolesForm.jsx | 43 | |
| 55 | ) | client/pages/admin/components/users/RolesForm.jsx | 44 | |
| 56 | )); | client/pages/admin/components/users/RolesForm.jsx | 45 | |
| 57 | } | client/pages/admin/components/users/RolesForm.jsx | 47 | |
| 58 | client/pages/admin/components/users/RolesForm.jsx | 48 | ||
| 59 | 2 | if (roles.admin) { | client/pages/admin/components/users/RolesForm.jsx | 50 |
| 60 | 1 | rolesUi.push(React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 51 |
| 61 | ControlGroup, | client/pages/admin/components/users/RolesForm.jsx | 52 | |
| 62 | { key: 'admin', label: 'Admin', hideHelp: true }, | client/pages/admin/components/users/RolesForm.jsx | 52 | |
| 63 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 52 | |
| 64 | 'div', | client/pages/admin/components/users/RolesForm.jsx | 53 | |
| 65 | { className: 'input-group' }, | client/pages/admin/components/users/RolesForm.jsx | 53 | |
| 66 | React.createElement('input', { | client/pages/admin/components/users/RolesForm.jsx | 53 | |
| 67 | type: 'text', | client/pages/admin/components/users/RolesForm.jsx | 55 | |
| 68 | className: 'form-control', | client/pages/admin/components/users/RolesForm.jsx | 56 | |
| 69 | disabled: true, | client/pages/admin/components/users/RolesForm.jsx | 57 | |
| 70 | value: roles.admin.name | client/pages/admin/components/users/RolesForm.jsx | 58 | |
| 71 | }), | client/pages/admin/components/users/RolesForm.jsx | 58 | |
| 72 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 59 | |
| 73 | 'span', | client/pages/admin/components/users/RolesForm.jsx | 60 | |
| 74 | { className: 'input-group-btn' }, | client/pages/admin/components/users/RolesForm.jsx | 60 | |
| 75 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 60 | |
| 76 | Link, | client/pages/admin/components/users/RolesForm.jsx | 61 | |
| 77 | { | client/pages/admin/components/users/RolesForm.jsx | 61 | |
| 78 | to: 'adminDetails', | client/pages/admin/components/users/RolesForm.jsx | 62 | |
| 79 | params: { id: roles.admin.id }, | client/pages/admin/components/users/RolesForm.jsx | 63 | |
| 80 | className: 'btn btn-default' }, | client/pages/admin/components/users/RolesForm.jsx | 64 | |
| 81 | 'View' | client/pages/admin/components/users/RolesForm.jsx | 64 | |
| 82 | ) | client/pages/admin/components/users/RolesForm.jsx | 64 | |
| 83 | ) | client/pages/admin/components/users/RolesForm.jsx | 67 | |
| 84 | ) | client/pages/admin/components/users/RolesForm.jsx | 68 | |
| 85 | )); | client/pages/admin/components/users/RolesForm.jsx | 69 | |
| 86 | } | client/pages/admin/components/users/RolesForm.jsx | 71 | |
| 87 | client/pages/admin/components/users/RolesForm.jsx | 72 | ||
| 88 | 2 | if (rolesUi.length === 0) { | client/pages/admin/components/users/RolesForm.jsx | 74 |
| 89 | 1 | rolesUi.push(React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 75 |
| 90 | ControlGroup, | client/pages/admin/components/users/RolesForm.jsx | 76 | |
| 91 | { key: 'empty', hideLabel: true, hideHelp: true }, | client/pages/admin/components/users/RolesForm.jsx | 76 | |
| 92 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 76 | |
| 93 | 'span', | client/pages/admin/components/users/RolesForm.jsx | 77 | |
| 94 | { className: 'label label-default' }, | client/pages/admin/components/users/RolesForm.jsx | 77 | |
| 95 | 'no roles defined' | client/pages/admin/components/users/RolesForm.jsx | 77 | |
| 96 | ) | client/pages/admin/components/users/RolesForm.jsx | 77 | |
| 97 | )); | client/pages/admin/components/users/RolesForm.jsx | 79 | |
| 98 | } | client/pages/admin/components/users/RolesForm.jsx | 81 | |
| 99 | client/pages/admin/components/users/RolesForm.jsx | 82 | ||
| 100 | 2 | formElements = React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 84 |
| 101 | 'fieldset', | client/pages/admin/components/users/RolesForm.jsx | 84 | |
| 102 | null, | client/pages/admin/components/users/RolesForm.jsx | 84 | |
| 103 | React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 84 | |
| 104 | 'legend', | client/pages/admin/components/users/RolesForm.jsx | 85 | |
| 105 | null, | client/pages/admin/components/users/RolesForm.jsx | 85 | |
| 106 | 'Roles' | client/pages/admin/components/users/RolesForm.jsx | 85 | |
| 107 | ), | client/pages/admin/components/users/RolesForm.jsx | 85 | |
| 108 | rolesUi | client/pages/admin/components/users/RolesForm.jsx | 85 | |
| 109 | ); | client/pages/admin/components/users/RolesForm.jsx | 86 | |
| 110 | } | client/pages/admin/components/users/RolesForm.jsx | 87 | |
| 111 | client/pages/admin/components/users/RolesForm.jsx | 88 | ||
| 112 | 10 | return React.createElement( | client/pages/admin/components/users/RolesForm.jsx | 90 |
| 113 | 'form', | client/pages/admin/components/users/RolesForm.jsx | 91 | |
| 114 | null, | client/pages/admin/components/users/RolesForm.jsx | 91 | |
| 115 | notice, | client/pages/admin/components/users/RolesForm.jsx | 91 | |
| 116 | formElements | client/pages/admin/components/users/RolesForm.jsx | 92 | |
| 117 | ); | client/pages/admin/components/users/RolesForm.jsx | 93 | |
| 118 | } | client/pages/admin/components/users/RolesForm.jsx | 95 | |
| 119 | }); | client/pages/admin/components/users/RolesForm.jsx | 96 | |
| 120 | client/pages/admin/components/users/RolesForm.jsx | 97 | ||
| 121 | 1 | module.exports = Component; | client/pages/admin/components/users/RolesForm.jsx | 100 |
| 122 | client/pages/admin/components/users/RolesForm.jsx | 100 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/admin/components/users/Search.jsx | 1 | |
| 2 | 'use strict'; | client/pages/admin/components/users/Search.jsx | 2 | |
| 3 | client/pages/admin/components/users/Search.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/admin/components/users/Search.jsx | 2 |
| 5 | 1 | var Paging = require('../../../../components/Paging'); | client/pages/admin/components/users/Search.jsx | 3 |
| 6 | 1 | var Actions = require('../../actions/User'); | client/pages/admin/components/users/Search.jsx | 4 |
| 7 | 1 | var UserStore = require('../../stores/User'); | client/pages/admin/components/users/Search.jsx | 5 |
| 8 | 1 | var FilterForm = require('./FilterForm'); | client/pages/admin/components/users/Search.jsx | 6 |
| 9 | 1 | var CreateNewForm = require('./CreateNewForm'); | client/pages/admin/components/users/Search.jsx | 7 |
| 10 | 1 | var Results = require('./Results'); | client/pages/admin/components/users/Search.jsx | 8 |
| 11 | client/pages/admin/components/users/Search.jsx | 8 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/admin/components/users/Search.jsx | 11 |
| 13 | displayName: 'Component', | client/pages/admin/components/users/Search.jsx | 11 | |
| 14 | client/pages/admin/components/users/Search.jsx | 11 | ||
| 15 | contextTypes: { | client/pages/admin/components/users/Search.jsx | 12 | |
| 16 | router: React.PropTypes.func | client/pages/admin/components/users/Search.jsx | 13 | |
| 17 | }, | client/pages/admin/components/users/Search.jsx | 13 | |
| 18 | getInitialState: function getInitialState() { | client/pages/admin/components/users/Search.jsx | 15 | |
| 19 | client/pages/admin/components/users/Search.jsx | 15 | ||
| 20 | 8 | UserStore.resetResults(); | client/pages/admin/components/users/Search.jsx | 17 |
| 21 | 8 | UserStore.resetCreateNew(); | client/pages/admin/components/users/Search.jsx | 18 |
| 22 | client/pages/admin/components/users/Search.jsx | 18 | ||
| 23 | 8 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/users/Search.jsx | 20 |
| 24 | client/pages/admin/components/users/Search.jsx | 20 | ||
| 25 | 8 | return { | client/pages/admin/components/users/Search.jsx | 22 |
| 26 | results: UserStore.getResults(), | client/pages/admin/components/users/Search.jsx | 23 | |
| 27 | createNew: UserStore.getCreateNew() | client/pages/admin/components/users/Search.jsx | 24 | |
| 28 | }; | client/pages/admin/components/users/Search.jsx | 24 | |
| 29 | }, | client/pages/admin/components/users/Search.jsx | 25 | |
| 30 | componentWillReceiveProps: function componentWillReceiveProps(nextProps) { | client/pages/admin/components/users/Search.jsx | 27 | |
| 31 | client/pages/admin/components/users/Search.jsx | 27 | ||
| 32 | 1 | Actions.getResults(this.context.router.getCurrentQuery()); | client/pages/admin/components/users/Search.jsx | 29 |
| 33 | }, | client/pages/admin/components/users/Search.jsx | 29 | |
| 34 | componentDidMount: function componentDidMount() { | client/pages/admin/components/users/Search.jsx | 31 | |
| 35 | client/pages/admin/components/users/Search.jsx | 31 | ||
| 36 | 8 | UserStore.addChangeListener(this.onStoreChange); | client/pages/admin/components/users/Search.jsx | 33 |
| 37 | }, | client/pages/admin/components/users/Search.jsx | 33 | |
| 38 | componentWillUnmount: function componentWillUnmount() { | client/pages/admin/components/users/Search.jsx | 35 | |
| 39 | client/pages/admin/components/users/Search.jsx | 35 | ||
| 40 | 1 | UserStore.removeChangeListener(this.onStoreChange); | client/pages/admin/components/users/Search.jsx | 37 |
| 41 | }, | client/pages/admin/components/users/Search.jsx | 37 | |
| 42 | onStoreChange: function onStoreChange() { | client/pages/admin/components/users/Search.jsx | 39 | |
| 43 | client/pages/admin/components/users/Search.jsx | 39 | ||
| 44 | 3 | this.setState({ | client/pages/admin/components/users/Search.jsx | 41 |
| 45 | results: UserStore.getResults(), | client/pages/admin/components/users/Search.jsx | 42 | |
| 46 | createNew: UserStore.getCreateNew() | client/pages/admin/components/users/Search.jsx | 43 | |
| 47 | }); | client/pages/admin/components/users/Search.jsx | 43 | |
| 48 | }, | client/pages/admin/components/users/Search.jsx | 44 | |
| 49 | onFiltersChange: function onFiltersChange(event) { | client/pages/admin/components/users/Search.jsx | 46 | |
| 50 | client/pages/admin/components/users/Search.jsx | 46 | ||
| 51 | 3 | if (event) { | client/pages/admin/components/users/Search.jsx | 48 |
| 52 | 1 | event.preventDefault(); | client/pages/admin/components/users/Search.jsx | 49 |
| 53 | 1 | event.stopPropagation(); | client/pages/admin/components/users/Search.jsx | 50 |
| 54 | } | client/pages/admin/components/users/Search.jsx | 50 | |
| 55 | client/pages/admin/components/users/Search.jsx | 51 | ||
| 56 | 3 | this.context.router.transitionTo('users', {}, this.refs.filters.state); | client/pages/admin/components/users/Search.jsx | 53 |
| 57 | 3 | window.scrollTo(0, 0); | client/pages/admin/components/users/Search.jsx | 54 |
| 58 | }, | client/pages/admin/components/users/Search.jsx | 54 | |
| 59 | onPageChange: function onPageChange(page) { | client/pages/admin/components/users/Search.jsx | 56 | |
| 60 | client/pages/admin/components/users/Search.jsx | 56 | ||
| 61 | 1 | this.refs.filters.changePage(page); | client/pages/admin/components/users/Search.jsx | 58 |
| 62 | }, | client/pages/admin/components/users/Search.jsx | 58 | |
| 63 | onNewClick: function onNewClick() { | client/pages/admin/components/users/Search.jsx | 60 | |
| 64 | client/pages/admin/components/users/Search.jsx | 60 | ||
| 65 | 1 | Actions.showCreateNew(); | client/pages/admin/components/users/Search.jsx | 62 |
| 66 | }, | client/pages/admin/components/users/Search.jsx | 62 | |
| 67 | render: function render() { | client/pages/admin/components/users/Search.jsx | 64 | |
| 68 | client/pages/admin/components/users/Search.jsx | 64 | ||
| 69 | 13 | return React.createElement( | client/pages/admin/components/users/Search.jsx | 66 |
| 70 | 'section', | client/pages/admin/components/users/Search.jsx | 67 | |
| 71 | { className: 'section-users container' }, | client/pages/admin/components/users/Search.jsx | 67 | |
| 72 | React.createElement( | client/pages/admin/components/users/Search.jsx | 67 | |
| 73 | 'div', | client/pages/admin/components/users/Search.jsx | 68 | |
| 74 | { className: 'page-header' }, | client/pages/admin/components/users/Search.jsx | 68 | |
| 75 | React.createElement( | client/pages/admin/components/users/Search.jsx | 68 | |
| 76 | 'button', | client/pages/admin/components/users/Search.jsx | 69 | |
| 77 | { | client/pages/admin/components/users/Search.jsx | 69 | |
| 78 | ref: 'createNew', | client/pages/admin/components/users/Search.jsx | 70 | |
| 79 | className: 'btn btn-default pull-right', | client/pages/admin/components/users/Search.jsx | 71 | |
| 80 | onClick: this.onNewClick }, | client/pages/admin/components/users/Search.jsx | 72 | |
| 81 | 'Create new' | client/pages/admin/components/users/Search.jsx | 72 | |
| 82 | ), | client/pages/admin/components/users/Search.jsx | 72 | |
| 83 | React.createElement( | client/pages/admin/components/users/Search.jsx | 75 | |
| 84 | 'h1', | client/pages/admin/components/users/Search.jsx | 76 | |
| 85 | null, | client/pages/admin/components/users/Search.jsx | 76 | |
| 86 | 'Users' | client/pages/admin/components/users/Search.jsx | 76 | |
| 87 | ) | client/pages/admin/components/users/Search.jsx | 76 | |
| 88 | ), | client/pages/admin/components/users/Search.jsx | 76 | |
| 89 | React.createElement(FilterForm, { | client/pages/admin/components/users/Search.jsx | 77 | |
| 90 | ref: 'filters', | client/pages/admin/components/users/Search.jsx | 79 | |
| 91 | query: this.context.router.getCurrentQuery(), | client/pages/admin/components/users/Search.jsx | 80 | |
| 92 | loading: this.state.results.loading, | client/pages/admin/components/users/Search.jsx | 81 | |
| 93 | onChange: this.onFiltersChange | client/pages/admin/components/users/Search.jsx | 82 | |
| 94 | }), | client/pages/admin/components/users/Search.jsx | 82 | |
| 95 | React.createElement(Results, { data: this.state.results.data }), | client/pages/admin/components/users/Search.jsx | 83 | |
| 96 | React.createElement(Paging, { | client/pages/admin/components/users/Search.jsx | 84 | |
| 97 | ref: 'paging', | client/pages/admin/components/users/Search.jsx | 86 | |
| 98 | pages: this.state.results.pages, | client/pages/admin/components/users/Search.jsx | 87 | |
| 99 | items: this.state.results.items, | client/pages/admin/components/users/Search.jsx | 88 | |
| 100 | loading: this.state.results.loading, | client/pages/admin/components/users/Search.jsx | 89 | |
| 101 | onChange: this.onPageChange | client/pages/admin/components/users/Search.jsx | 90 | |
| 102 | }), | client/pages/admin/components/users/Search.jsx | 90 | |
| 103 | React.createElement(CreateNewForm, { data: this.state.createNew }) | client/pages/admin/components/users/Search.jsx | 91 | |
| 104 | ); | client/pages/admin/components/users/Search.jsx | 92 | |
| 105 | } | client/pages/admin/components/users/Search.jsx | 94 | |
| 106 | }); | client/pages/admin/components/users/Search.jsx | 95 | |
| 107 | client/pages/admin/components/users/Search.jsx | 96 | ||
| 108 | 1 | module.exports = Component; | client/pages/admin/components/users/Search.jsx | 99 |
| 109 | client/pages/admin/components/users/Search.jsx | 99 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'GET_RESULTS', | |
| 9 | 'GET_RESULTS_RESPONSE', | |
| 10 | 'GET_DETAILS', | |
| 11 | 'GET_DETAILS_RESPONSE', | |
| 12 | 'SHOW_CREATE_NEW', | |
| 13 | 'HIDE_CREATE_NEW', | |
| 14 | 'CREATE_NEW', | |
| 15 | 'CREATE_NEW_RESPONSE', | |
| 16 | 'SAVE_DETAILS', | |
| 17 | 'SAVE_DETAILS_RESPONSE', | |
| 18 | 'LINK_USER', | |
| 19 | 'LINK_USER_RESPONSE', | |
| 20 | 'UNLINK_USER', | |
| 21 | 'UNLINK_USER_RESPONSE', | |
| 22 | 'NEW_STATUS', | |
| 23 | 'NEW_STATUS_RESPONSE', | |
| 24 | 'NEW_NOTE', | |
| 25 | 'NEW_NOTE_RESPONSE', | |
| 26 | 'DELETE', | |
| 27 | 'DELETE_RESPONSE' | |
| 28 | ]) | |
| 29 | }; | |
| 30 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'GET_RESULTS', | |
| 9 | 'GET_RESULTS_RESPONSE', | |
| 10 | 'GET_DETAILS', | |
| 11 | 'GET_DETAILS_RESPONSE', | |
| 12 | 'SHOW_CREATE_NEW', | |
| 13 | 'HIDE_CREATE_NEW', | |
| 14 | 'CREATE_NEW', | |
| 15 | 'CREATE_NEW_RESPONSE', | |
| 16 | 'SAVE_DETAILS', | |
| 17 | 'SAVE_DETAILS_RESPONSE', | |
| 18 | 'LINK_USER', | |
| 19 | 'LINK_USER_RESPONSE', | |
| 20 | 'UNLINK_USER', | |
| 21 | 'UNLINK_USER_RESPONSE', | |
| 22 | 'SAVE_GROUPS', | |
| 23 | 'SAVE_GROUPS_RESPONSE', | |
| 24 | 'SAVE_PERMISSIONS', | |
| 25 | 'SAVE_PERMISSIONS_RESPONSE', | |
| 26 | 'DELETE', | |
| 27 | 'DELETE_RESPONSE' | |
| 28 | ]) | |
| 29 | }; | |
| 30 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'GET_RESULTS', | |
| 9 | 'GET_RESULTS_RESPONSE', | |
| 10 | 'GET_DETAILS', | |
| 11 | 'GET_DETAILS_RESPONSE', | |
| 12 | 'SHOW_CREATE_NEW', | |
| 13 | 'HIDE_CREATE_NEW', | |
| 14 | 'CREATE_NEW', | |
| 15 | 'CREATE_NEW_RESPONSE', | |
| 16 | 'SAVE_DETAILS', | |
| 17 | 'SAVE_DETAILS_RESPONSE', | |
| 18 | 'SAVE_PERMISSIONS', | |
| 19 | 'SAVE_PERMISSIONS_RESPONSE', | |
| 20 | 'DELETE', | |
| 21 | 'DELETE_RESPONSE' | |
| 22 | ]) | |
| 23 | }; | |
| 24 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'GET_RESULTS', | |
| 9 | 'GET_RESULTS_RESPONSE', | |
| 10 | 'GET_DETAILS', | |
| 11 | 'GET_DETAILS_RESPONSE', | |
| 12 | 'SHOW_CREATE_NEW', | |
| 13 | 'HIDE_CREATE_NEW', | |
| 14 | 'CREATE_NEW', | |
| 15 | 'CREATE_NEW_RESPONSE', | |
| 16 | 'SAVE_DETAILS', | |
| 17 | 'SAVE_DETAILS_RESPONSE', | |
| 18 | 'DELETE', | |
| 19 | 'DELETE_RESPONSE' | |
| 20 | ]) | |
| 21 | }; | |
| 22 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'GET_RESULTS', | |
| 9 | 'GET_RESULTS_RESPONSE', | |
| 10 | 'GET_IDENTITY', | |
| 11 | 'GET_IDENTITY_RESPONSE', | |
| 12 | 'SHOW_CREATE_NEW', | |
| 13 | 'HIDE_CREATE_NEW', | |
| 14 | 'CREATE_NEW', | |
| 15 | 'CREATE_NEW_RESPONSE', | |
| 16 | 'SAVE_IDENTITY', | |
| 17 | 'SAVE_IDENTITY_RESPONSE', | |
| 18 | 'SAVE_PASSWORD', | |
| 19 | 'SAVE_PASSWORD_RESPONSE', | |
| 20 | 'DELETE', | |
| 21 | 'DELETE_RESPONSE' | |
| 22 | ]) | |
| 23 | }; | |
| 24 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var Moment = require('moment'); |
| 4 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 5 | 1 | var Constants = require('../constants/Account'); |
| 6 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 7 | ||
| 8 | ||
| 9 | 1 | var ActionTypes = Constants.ActionTypes; |
| 10 | ||
| 11 | ||
| 12 | 1 | var Store = FluxStore.extend({ |
| 13 | dispatcher: Dispatcher, | |
| 14 | state: {}, | |
| 15 | defaultState: { | |
| 16 | results: { | |
| 17 | hydrated: false, | |
| 18 | loading: false, | |
| 19 | success: false, | |
| 20 | error: undefined, | |
| 21 | data: [], | |
| 22 | pages: {}, | |
| 23 | items: {} | |
| 24 | }, | |
| 25 | createNew: { | |
| 26 | show: false, | |
| 27 | loading: false, | |
| 28 | error: undefined, | |
| 29 | hasError: {}, | |
| 30 | help: {}, | |
| 31 | _id: undefined, | |
| 32 | name: {} | |
| 33 | }, | |
| 34 | details: { | |
| 35 | hydrated: false, | |
| 36 | fetchFailure: false, | |
| 37 | loading: false, | |
| 38 | success: false, | |
| 39 | error: undefined, | |
| 40 | hasError: {}, | |
| 41 | help: {}, | |
| 42 | _id: undefined, | |
| 43 | name: {}, | |
| 44 | user: {}, | |
| 45 | status: { | |
| 46 | current: {}, | |
| 47 | log: [] | |
| 48 | }, | |
| 49 | notes: [] | |
| 50 | }, | |
| 51 | user: { | |
| 52 | loading: false, | |
| 53 | success: false, | |
| 54 | error: undefined, | |
| 55 | hasError: {}, | |
| 56 | help: {} | |
| 57 | }, | |
| 58 | status: { | |
| 59 | loading: false, | |
| 60 | success: false, | |
| 61 | error: undefined, | |
| 62 | hasError: {}, | |
| 63 | help: {} | |
| 64 | }, | |
| 65 | note: { | |
| 66 | loading: false, | |
| 67 | success: false, | |
| 68 | error: undefined, | |
| 69 | hasError: {}, | |
| 70 | help: {} | |
| 71 | }, | |
| 72 | delete: { | |
| 73 | loading: false, | |
| 74 | error: undefined | |
| 75 | } | |
| 76 | }, | |
| 77 | getState: function () { | |
| 78 | ||
| 79 | 1 | return this.state; |
| 80 | }, | |
| 81 | getResults: function () { | |
| 82 | ||
| 83 | 14 | return this.state.results; |
| 84 | }, | |
| 85 | getCreateNew: function () { | |
| 86 | ||
| 87 | 17 | return this.state.createNew; |
| 88 | }, | |
| 89 | getDetails: function () { | |
| 90 | ||
| 91 | 15 | return this.state.details; |
| 92 | }, | |
| 93 | getUser: function () { | |
| 94 | ||
| 95 | 13 | return this.state.user; |
| 96 | }, | |
| 97 | getStatus: function () { | |
| 98 | ||
| 99 | 10 | return this.state.status; |
| 100 | }, | |
| 101 | getNote: function () { | |
| 102 | ||
| 103 | 10 | return this.state.note; |
| 104 | }, | |
| 105 | getDelete: function () { | |
| 106 | ||
| 107 | 9 | return this.state.delete; |
| 108 | }, | |
| 109 | reset: function () { | |
| 110 | ||
| 111 | 1 | this.state = { |
| 112 | results: CloneDeep(this.defaultState.results), | |
| 113 | createNew: CloneDeep(this.defaultState.createNew), | |
| 114 | details: CloneDeep(this.defaultState.details), | |
| 115 | user: CloneDeep(this.defaultState.user), | |
| 116 | status: CloneDeep(this.defaultState.status), | |
| 117 | note: CloneDeep(this.defaultState.note), | |
| 118 | delete: CloneDeep(this.defaultState.delete) | |
| 119 | }; | |
| 120 | }, | |
| 121 | resetResults: function () { | |
| 122 | ||
| 123 | 9 | this.state.results = CloneDeep(this.defaultState.results); |
| 124 | }, | |
| 125 | resetCreateNew: function () { | |
| 126 | ||
| 127 | 12 | this.state.createNew = CloneDeep(this.defaultState.createNew); |
| 128 | }, | |
| 129 | resetDetails: function () { | |
| 130 | ||
| 131 | 5 | this.state.details = CloneDeep(this.defaultState.details); |
| 132 | }, | |
| 133 | resetUser: function () { | |
| 134 | ||
| 135 | 5 | this.state.user = CloneDeep(this.defaultState.user); |
| 136 | }, | |
| 137 | resetStatus: function () { | |
| 138 | ||
| 139 | 5 | this.state.status = CloneDeep(this.defaultState.status); |
| 140 | }, | |
| 141 | resetNote: function () { | |
| 142 | ||
| 143 | 5 | this.state.note = CloneDeep(this.defaultState.note); |
| 144 | }, | |
| 145 | resetDelete: function () { | |
| 146 | ||
| 147 | 5 | this.state.delete = CloneDeep(this.defaultState.delete); |
| 148 | }, | |
| 149 | resetValidationErrors: function (pivot) { | |
| 150 | ||
| 151 | 9 | this.state[pivot].error = undefined; |
| 152 | 9 | this.state[pivot].hasError = {}; |
| 153 | 9 | this.state[pivot].help = {}; |
| 154 | }, | |
| 155 | handleValidationErrors: function (pivot, data) { | |
| 156 | ||
| 157 | 17 | var validation = ParseValidation(data.validation, data.message); |
| 158 | ||
| 159 | 17 | this.state[pivot].hasError = validation.hasError; |
| 160 | 17 | this.state[pivot].help = validation.help; |
| 161 | 17 | this.state[pivot].error = validation.error; |
| 162 | }, | |
| 163 | convertStatusDetails: function (status) { | |
| 164 | ||
| 165 | 5 | status = status || {}; |
| 166 | 5 | status.current = status.current || {}; |
| 167 | 5 | status.log = status.log || []; |
| 168 | 5 | status.log.reverse(); |
| 169 | 5 | status.log.forEach(function (item, index) { |
| 170 | ||
| 171 | 1 | status.log[index].moment = Moment(item.timeCreated); |
| 172 | }); | |
| 173 | ||
| 174 | 5 | return status; |
| 175 | }, | |
| 176 | convertNotesDetails: function (notes) { | |
| 177 | ||
| 178 | 4 | notes = notes || []; |
| 179 | 4 | notes.reverse(); |
| 180 | 4 | notes.forEach(function (item, index) { |
| 181 | ||
| 182 | 1 | notes[index].moment = Moment(item.timeCreated); |
| 183 | }); | |
| 184 | ||
| 185 | 4 | return notes; |
| 186 | }, | |
| 187 | onDispatcherAction: function (payload) { | |
| 188 | ||
| 189 | 154 | var action = payload.action; |
| 190 | ||
| 191 | 154 | if (ActionTypes.GET_RESULTS === action.type) { |
| 192 | 1 | this.state.results.loading = true; |
| 193 | 1 | this.state.results.hydrated = false; |
| 194 | 1 | this.state.results.success = false; |
| 195 | 1 | this.emitChange(); |
| 196 | } | |
| 197 | ||
| 198 | 154 | if (ActionTypes.GET_RESULTS_RESPONSE === action.type) { |
| 199 | 1 | this.state.results.loading = false; |
| 200 | 1 | this.state.results.hydrated = true; |
| 201 | 1 | this.state.results.success = action.data.success; |
| 202 | 1 | this.state.results.data = action.data.data; |
| 203 | 1 | this.state.results.pages = action.data.pages; |
| 204 | 1 | this.state.results.items = action.data.items; |
| 205 | 1 | this.emitChange(); |
| 206 | } | |
| 207 | ||
| 208 | 154 | if (ActionTypes.SHOW_CREATE_NEW === action.type) { |
| 209 | 2 | this.resetCreateNew(); |
| 210 | 2 | this.state.createNew.show = true; |
| 211 | 2 | this.emitChange(); |
| 212 | } | |
| 213 | ||
| 214 | 154 | if (ActionTypes.HIDE_CREATE_NEW === action.type) { |
| 215 | 1 | this.state.createNew.show = false; |
| 216 | 1 | this.emitChange(); |
| 217 | } | |
| 218 | ||
| 219 | 154 | if (ActionTypes.CREATE_NEW === action.type) { |
| 220 | 1 | this.state.createNew.loading = true; |
| 221 | 1 | this.resetValidationErrors('createNew'); |
| 222 | 1 | this.emitChange(); |
| 223 | } | |
| 224 | ||
| 225 | 154 | if (ActionTypes.CREATE_NEW_RESPONSE === action.type) { |
| 226 | 2 | this.state.createNew.loading = false; |
| 227 | 2 | this.handleValidationErrors('createNew', action.data); |
| 228 | ||
| 229 | 2 | if (action.data.hasOwnProperty('_id')) { |
| 230 | 1 | this.resetCreateNew(); |
| 231 | } | |
| 232 | ||
| 233 | 2 | this.emitChange(); |
| 234 | } | |
| 235 | ||
| 236 | 154 | if (ActionTypes.GET_DETAILS === action.type) { |
| 237 | 1 | this.state.details.loading = true; |
| 238 | 1 | this.state.details.hydrated = false; |
| 239 | 1 | this.state.details.success = false; |
| 240 | 1 | this.emitChange(); |
| 241 | } | |
| 242 | ||
| 243 | 154 | if (ActionTypes.GET_DETAILS_RESPONSE === action.type) { |
| 244 | 1 | this.handleValidationErrors('details', action.data); |
| 245 | 1 | this.state.details.loading = false; |
| 246 | 1 | this.state.details.hydrated = true; |
| 247 | 1 | this.state.details.fetchFailure = action.data.fetchFailure; |
| 248 | 1 | this.state.details.success = action.data.success; |
| 249 | 1 | this.state.details._id = action.data._id; |
| 250 | 1 | this.state.details.name = action.data.name; |
| 251 | 1 | this.state.details.user = action.data.user; |
| 252 | 1 | this.state.details.status = this.convertStatusDetails(action.data.status); |
| 253 | 1 | this.state.details.notes = this.convertNotesDetails(action.data.notes); |
| 254 | 1 | this.emitChange(); |
| 255 | } | |
| 256 | ||
| 257 | 154 | if (ActionTypes.SAVE_DETAILS === action.type) { |
| 258 | 1 | this.state.details.loading = true; |
| 259 | 1 | this.emitChange(); |
| 260 | } | |
| 261 | ||
| 262 | 154 | if (ActionTypes.SAVE_DETAILS_RESPONSE === action.type) { |
| 263 | 2 | this.state.details.loading = false; |
| 264 | 2 | this.state.details.success = action.data.success; |
| 265 | 2 | this.handleValidationErrors('details', action.data); |
| 266 | ||
| 267 | 2 | if (action.data.success) { |
| 268 | 1 | setTimeout(function () { |
| 269 | ||
| 270 | 1 | this.state.details.success = undefined; |
| 271 | 1 | this.emitChange(); |
| 272 | }.bind(this), 2500); | |
| 273 | ||
| 274 | 1 | this.resetValidationErrors('details'); |
| 275 | 1 | this.state.details.name = action.data.name; |
| 276 | } | |
| 277 | ||
| 278 | 2 | this.emitChange(); |
| 279 | } | |
| 280 | ||
| 281 | 154 | if (ActionTypes.LINK_USER === action.type) { |
| 282 | 1 | this.resetValidationErrors('user'); |
| 283 | 1 | this.state.user.loading = true; |
| 284 | 1 | this.emitChange(); |
| 285 | } | |
| 286 | ||
| 287 | 154 | if (ActionTypes.LINK_USER_RESPONSE === action.type) { |
| 288 | 2 | this.state.user.loading = false; |
| 289 | 2 | this.state.user.success = action.data.success; |
| 290 | 2 | this.handleValidationErrors('user', action.data); |
| 291 | ||
| 292 | 2 | setTimeout(function () { |
| 293 | ||
| 294 | 2 | this.state.user.success = undefined; |
| 295 | 2 | this.state.user.error = undefined; |
| 296 | 2 | this.emitChange(); |
| 297 | }.bind(this), 2500); | |
| 298 | ||
| 299 | 2 | if (action.data.success) { |
| 300 | 1 | this.resetValidationErrors('user'); |
| 301 | 1 | this.state.details.user = action.data.user; |
| 302 | } | |
| 303 | ||
| 304 | 2 | this.emitChange(); |
| 305 | } | |
| 306 | ||
| 307 | 154 | if (ActionTypes.UNLINK_USER === action.type) { |
| 308 | 1 | this.resetValidationErrors('user'); |
| 309 | 1 | this.state.user.loading = true; |
| 310 | 1 | this.emitChange(); |
| 311 | } | |
| 312 | ||
| 313 | 154 | if (ActionTypes.UNLINK_USER_RESPONSE === action.type) { |
| 314 | 2 | this.state.user.loading = false; |
| 315 | 2 | this.state.user.success = action.data.success; |
| 316 | 2 | this.handleValidationErrors('user', action.data); |
| 317 | ||
| 318 | 2 | setTimeout(function () { |
| 319 | ||
| 320 | 2 | this.state.user.success = undefined; |
| 321 | 2 | this.state.user.error = undefined; |
| 322 | 2 | this.emitChange(); |
| 323 | }.bind(this), 2500); | |
| 324 | ||
| 325 | 2 | if (action.data.success) { |
| 326 | 1 | this.resetValidationErrors('user'); |
| 327 | 1 | this.state.details.user = action.data.user; |
| 328 | } | |
| 329 | ||
| 330 | 2 | this.emitChange(); |
| 331 | } | |
| 332 | ||
| 333 | 154 | if (ActionTypes.NEW_STATUS === action.type) { |
| 334 | 1 | this.resetValidationErrors('status'); |
| 335 | 1 | this.state.status.loading = true; |
| 336 | 1 | this.emitChange(); |
| 337 | } | |
| 338 | ||
| 339 | 154 | if (ActionTypes.NEW_STATUS_RESPONSE === action.type) { |
| 340 | 2 | this.state.status.loading = false; |
| 341 | 2 | this.state.status.success = action.data.success; |
| 342 | 2 | this.handleValidationErrors('status', action.data); |
| 343 | ||
| 344 | 2 | setTimeout(function () { |
| 345 | ||
| 346 | 2 | this.state.status.success = undefined; |
| 347 | 2 | this.state.status.error = undefined; |
| 348 | 2 | this.emitChange(); |
| 349 | }.bind(this), 2500); | |
| 350 | ||
| 351 | 2 | if (action.data.success) { |
| 352 | 1 | this.state.details.status = this.convertStatusDetails(action.data.status); |
| 353 | } | |
| 354 | ||
| 355 | 2 | this.emitChange(); |
| 356 | } | |
| 357 | ||
| 358 | 154 | if (ActionTypes.NEW_NOTE === action.type) { |
| 359 | 1 | this.resetValidationErrors('note'); |
| 360 | 1 | this.state.note.loading = true; |
| 361 | 1 | this.emitChange(); |
| 362 | } | |
| 363 | ||
| 364 | 154 | if (ActionTypes.NEW_NOTE_RESPONSE === action.type) { |
| 365 | 2 | this.state.note.loading = false; |
| 366 | 2 | this.state.note.success = action.data.success; |
| 367 | 2 | this.handleValidationErrors('note', action.data); |
| 368 | ||
| 369 | 2 | setTimeout(function () { |
| 370 | ||
| 371 | 2 | this.state.note.success = undefined; |
| 372 | 2 | this.state.note.error = undefined; |
| 373 | 2 | this.emitChange(); |
| 374 | }.bind(this), 2500); | |
| 375 | ||
| 376 | 2 | if (action.data.success) { |
| 377 | 1 | this.state.details.notes = this.convertNotesDetails(action.data.notes); |
| 378 | } | |
| 379 | ||
| 380 | 2 | this.emitChange(); |
| 381 | } | |
| 382 | ||
| 383 | 154 | if (ActionTypes.DELETE === action.type) { |
| 384 | 1 | this.state.delete.loading = true; |
| 385 | 1 | this.emitChange(); |
| 386 | } | |
| 387 | ||
| 388 | 154 | if (ActionTypes.DELETE_RESPONSE === action.type) { |
| 389 | 2 | this.state.delete.loading = false; |
| 390 | 2 | this.handleValidationErrors('delete', action.data); |
| 391 | ||
| 392 | 2 | if (action.data.success) { |
| 393 | 1 | this.resetValidationErrors('delete'); |
| 394 | } | |
| 395 | else { | |
| 396 | 1 | setTimeout(function () { |
| 397 | ||
| 398 | 1 | this.state.delete.error = undefined; |
| 399 | 1 | this.emitChange(); |
| 400 | }.bind(this), 2500); | |
| 401 | } | |
| 402 | ||
| 403 | 2 | this.emitChange(); |
| 404 | } | |
| 405 | } | |
| 406 | }); | |
| 407 | ||
| 408 | ||
| 409 | 1 | module.exports = Store; |
| 410 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../constants/Admin'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | results: { | |
| 16 | hydrated: false, | |
| 17 | loading: false, | |
| 18 | success: false, | |
| 19 | error: undefined, | |
| 20 | data: [], | |
| 21 | pages: {}, | |
| 22 | items: {} | |
| 23 | }, | |
| 24 | createNew: { | |
| 25 | show: false, | |
| 26 | loading: false, | |
| 27 | error: undefined, | |
| 28 | hasError: {}, | |
| 29 | help: {}, | |
| 30 | _id: undefined, | |
| 31 | name: {} | |
| 32 | }, | |
| 33 | details: { | |
| 34 | hydrated: false, | |
| 35 | fetchFailure: false, | |
| 36 | loading: false, | |
| 37 | success: false, | |
| 38 | error: undefined, | |
| 39 | hasError: {}, | |
| 40 | help: {}, | |
| 41 | _id: undefined, | |
| 42 | name: {}, | |
| 43 | permissions: {}, | |
| 44 | user: undefined, | |
| 45 | groups: {} | |
| 46 | }, | |
| 47 | user: { | |
| 48 | loading: false, | |
| 49 | success: false, | |
| 50 | error: undefined, | |
| 51 | hasError: {}, | |
| 52 | help: {} | |
| 53 | }, | |
| 54 | groups: { | |
| 55 | loading: false, | |
| 56 | success: false, | |
| 57 | error: undefined | |
| 58 | }, | |
| 59 | permissions: { | |
| 60 | loading: false, | |
| 61 | success: false, | |
| 62 | error: undefined | |
| 63 | }, | |
| 64 | delete: { | |
| 65 | loading: false, | |
| 66 | error: undefined | |
| 67 | } | |
| 68 | }, | |
| 69 | getState: function () { | |
| 70 | ||
| 71 | 1 | return this.state; |
| 72 | }, | |
| 73 | getResults: function () { | |
| 74 | ||
| 75 | 14 | return this.state.results; |
| 76 | }, | |
| 77 | getCreateNew: function () { | |
| 78 | ||
| 79 | 17 | return this.state.createNew; |
| 80 | }, | |
| 81 | getDetails: function () { | |
| 82 | ||
| 83 | 15 | return this.state.details; |
| 84 | }, | |
| 85 | getUser: function () { | |
| 86 | ||
| 87 | 13 | return this.state.user; |
| 88 | }, | |
| 89 | getGroups: function () { | |
| 90 | ||
| 91 | 10 | return this.state.groups; |
| 92 | }, | |
| 93 | getPermissions: function () { | |
| 94 | ||
| 95 | 10 | return this.state.permissions; |
| 96 | }, | |
| 97 | getDelete: function () { | |
| 98 | ||
| 99 | 11 | return this.state.delete; |
| 100 | }, | |
| 101 | reset: function () { | |
| 102 | ||
| 103 | 1 | this.state = { |
| 104 | results: CloneDeep(this.defaultState.results), | |
| 105 | createNew: CloneDeep(this.defaultState.createNew), | |
| 106 | details: CloneDeep(this.defaultState.details), | |
| 107 | user: CloneDeep(this.defaultState.user), | |
| 108 | groups: CloneDeep(this.defaultState.groups), | |
| 109 | permissions: CloneDeep(this.defaultState.permissions), | |
| 110 | delete: CloneDeep(this.defaultState.delete) | |
| 111 | }; | |
| 112 | }, | |
| 113 | resetResults: function () { | |
| 114 | ||
| 115 | 9 | this.state.results = CloneDeep(this.defaultState.results); |
| 116 | }, | |
| 117 | resetCreateNew: function () { | |
| 118 | ||
| 119 | 12 | this.state.createNew = CloneDeep(this.defaultState.createNew); |
| 120 | }, | |
| 121 | resetDetails: function () { | |
| 122 | ||
| 123 | 5 | this.state.details = CloneDeep(this.defaultState.details); |
| 124 | }, | |
| 125 | resetUser: function () { | |
| 126 | ||
| 127 | 5 | this.state.user = CloneDeep(this.defaultState.user); |
| 128 | }, | |
| 129 | resetGroups: function () { | |
| 130 | ||
| 131 | 5 | this.state.groups = CloneDeep(this.defaultState.groups); |
| 132 | }, | |
| 133 | resetPermissions: function () { | |
| 134 | ||
| 135 | 5 | this.state.permissions = CloneDeep(this.defaultState.permissions); |
| 136 | }, | |
| 137 | resetDelete: function () { | |
| 138 | ||
| 139 | 6 | this.state.delete = CloneDeep(this.defaultState.delete); |
| 140 | }, | |
| 141 | resetValidationErrors: function (pivot) { | |
| 142 | ||
| 143 | 9 | this.state[pivot].error = undefined; |
| 144 | 9 | this.state[pivot].hasError = {}; |
| 145 | 9 | this.state[pivot].help = {}; |
| 146 | }, | |
| 147 | handleValidationErrors: function (pivot, data) { | |
| 148 | ||
| 149 | 17 | var validation = ParseValidation(data.validation, data.message); |
| 150 | ||
| 151 | 17 | this.state[pivot].hasError = validation.hasError; |
| 152 | 17 | this.state[pivot].help = validation.help; |
| 153 | 17 | this.state[pivot].error = validation.error; |
| 154 | }, | |
| 155 | onDispatcherAction: function (payload) { | |
| 156 | ||
| 157 | 154 | var action = payload.action; |
| 158 | ||
| 159 | 154 | if (ActionTypes.GET_RESULTS === action.type) { |
| 160 | 1 | this.state.results.loading = true; |
| 161 | 1 | this.state.results.hydrated = false; |
| 162 | 1 | this.state.results.success = false; |
| 163 | 1 | this.emitChange(); |
| 164 | } | |
| 165 | ||
| 166 | 154 | if (ActionTypes.GET_RESULTS_RESPONSE === action.type) { |
| 167 | 1 | this.state.results.loading = false; |
| 168 | 1 | this.state.results.hydrated = true; |
| 169 | 1 | this.state.results.success = action.data.success; |
| 170 | 1 | this.state.results.data = action.data.data; |
| 171 | 1 | this.state.results.pages = action.data.pages; |
| 172 | 1 | this.state.results.items = action.data.items; |
| 173 | 1 | this.emitChange(); |
| 174 | } | |
| 175 | ||
| 176 | 154 | if (ActionTypes.SHOW_CREATE_NEW === action.type) { |
| 177 | 2 | this.resetCreateNew(); |
| 178 | 2 | this.state.createNew.show = true; |
| 179 | 2 | this.emitChange(); |
| 180 | } | |
| 181 | ||
| 182 | 154 | if (ActionTypes.HIDE_CREATE_NEW === action.type) { |
| 183 | 1 | this.state.createNew.show = false; |
| 184 | 1 | this.emitChange(); |
| 185 | } | |
| 186 | ||
| 187 | 154 | if (ActionTypes.CREATE_NEW === action.type) { |
| 188 | 1 | this.state.createNew.loading = true; |
| 189 | 1 | this.resetValidationErrors('createNew'); |
| 190 | 1 | this.emitChange(); |
| 191 | } | |
| 192 | ||
| 193 | 154 | if (ActionTypes.CREATE_NEW_RESPONSE === action.type) { |
| 194 | 2 | this.state.createNew.loading = false; |
| 195 | 2 | this.handleValidationErrors('createNew', action.data); |
| 196 | ||
| 197 | 2 | if (action.data.hasOwnProperty('_id')) { |
| 198 | 1 | this.resetCreateNew(); |
| 199 | } | |
| 200 | ||
| 201 | 2 | this.emitChange(); |
| 202 | } | |
| 203 | ||
| 204 | 154 | if (ActionTypes.GET_DETAILS === action.type) { |
| 205 | 1 | this.state.details.loading = true; |
| 206 | 1 | this.state.details.hydrated = false; |
| 207 | 1 | this.state.details.success = false; |
| 208 | 1 | this.emitChange(); |
| 209 | } | |
| 210 | ||
| 211 | 154 | if (ActionTypes.GET_DETAILS_RESPONSE === action.type) { |
| 212 | 1 | this.handleValidationErrors('details', action.data); |
| 213 | 1 | this.state.details.loading = false; |
| 214 | 1 | this.state.details.hydrated = true; |
| 215 | 1 | this.state.details.fetchFailure = action.data.fetchFailure; |
| 216 | 1 | this.state.details.success = action.data.success; |
| 217 | 1 | this.state.details._id = action.data._id; |
| 218 | 1 | this.state.details.name = action.data.name; |
| 219 | 1 | this.state.details.permissions = action.data.permissions; |
| 220 | 1 | this.state.details.groups = action.data.groups; |
| 221 | 1 | this.state.details.user = action.data.user; |
| 222 | 1 | this.emitChange(); |
| 223 | } | |
| 224 | ||
| 225 | 154 | if (ActionTypes.SAVE_DETAILS === action.type) { |
| 226 | 1 | this.state.details.loading = true; |
| 227 | 1 | this.emitChange(); |
| 228 | } | |
| 229 | ||
| 230 | 154 | if (ActionTypes.SAVE_DETAILS_RESPONSE === action.type) { |
| 231 | 2 | this.state.details.loading = false; |
| 232 | 2 | this.state.details.success = action.data.success; |
| 233 | 2 | this.handleValidationErrors('details', action.data); |
| 234 | ||
| 235 | 2 | if (action.data.success) { |
| 236 | 1 | setTimeout(function () { |
| 237 | ||
| 238 | 1 | this.state.details.success = undefined; |
| 239 | 1 | this.emitChange(); |
| 240 | }.bind(this), 2500); | |
| 241 | ||
| 242 | 1 | this.resetValidationErrors('details'); |
| 243 | 1 | this.state.details.name = action.data.name; |
| 244 | } | |
| 245 | ||
| 246 | 2 | this.emitChange(); |
| 247 | } | |
| 248 | ||
| 249 | 154 | if (ActionTypes.LINK_USER === action.type) { |
| 250 | 1 | this.resetValidationErrors('user'); |
| 251 | 1 | this.state.user.loading = true; |
| 252 | 1 | this.emitChange(); |
| 253 | } | |
| 254 | ||
| 255 | 154 | if (ActionTypes.LINK_USER_RESPONSE === action.type) { |
| 256 | 2 | this.state.user.loading = false; |
| 257 | 2 | this.state.user.success = action.data.success; |
| 258 | 2 | this.handleValidationErrors('user', action.data); |
| 259 | ||
| 260 | 2 | setTimeout(function () { |
| 261 | ||
| 262 | 2 | this.state.user.success = undefined; |
| 263 | 2 | this.state.user.error = undefined; |
| 264 | 2 | this.emitChange(); |
| 265 | }.bind(this), 2500); | |
| 266 | ||
| 267 | 2 | if (action.data.success) { |
| 268 | 1 | this.resetValidationErrors('user'); |
| 269 | 1 | this.state.details.user = action.data.user; |
| 270 | } | |
| 271 | ||
| 272 | 2 | this.emitChange(); |
| 273 | } | |
| 274 | ||
| 275 | 154 | if (ActionTypes.UNLINK_USER === action.type) { |
| 276 | 1 | this.resetValidationErrors('user'); |
| 277 | 1 | this.state.user.loading = true; |
| 278 | 1 | this.emitChange(); |
| 279 | } | |
| 280 | ||
| 281 | 154 | if (ActionTypes.UNLINK_USER_RESPONSE === action.type) { |
| 282 | 2 | this.state.user.loading = false; |
| 283 | 2 | this.state.user.success = action.data.success; |
| 284 | 2 | this.handleValidationErrors('user', action.data); |
| 285 | ||
| 286 | 2 | setTimeout(function () { |
| 287 | ||
| 288 | 2 | this.state.user.success = undefined; |
| 289 | 2 | this.state.user.error = undefined; |
| 290 | 2 | this.emitChange(); |
| 291 | }.bind(this), 2500); | |
| 292 | ||
| 293 | 2 | if (action.data.success) { |
| 294 | 1 | this.resetValidationErrors('user'); |
| 295 | 1 | this.state.details.user = action.data.user; |
| 296 | } | |
| 297 | ||
| 298 | 2 | this.emitChange(); |
| 299 | } | |
| 300 | ||
| 301 | 154 | if (ActionTypes.SAVE_GROUPS === action.type) { |
| 302 | 1 | this.state.groups.loading = true; |
| 303 | 1 | this.emitChange(); |
| 304 | } | |
| 305 | ||
| 306 | 154 | if (ActionTypes.SAVE_GROUPS_RESPONSE === action.type) { |
| 307 | 2 | this.state.groups.loading = false; |
| 308 | 2 | this.state.groups.success = action.data.success; |
| 309 | 2 | this.handleValidationErrors('groups', action.data); |
| 310 | ||
| 311 | 2 | if (action.data.success) { |
| 312 | 1 | setTimeout(function () { |
| 313 | ||
| 314 | 1 | this.state.groups.success = undefined; |
| 315 | 1 | this.emitChange(); |
| 316 | }.bind(this), 2500); | |
| 317 | ||
| 318 | 1 | this.resetValidationErrors('groups'); |
| 319 | 1 | this.state.groups.groups = action.data.groups; |
| 320 | } | |
| 321 | ||
| 322 | 2 | this.emitChange(); |
| 323 | } | |
| 324 | ||
| 325 | 154 | if (ActionTypes.SAVE_PERMISSIONS === action.type) { |
| 326 | 1 | this.state.permissions.loading = true; |
| 327 | 1 | this.emitChange(); |
| 328 | } | |
| 329 | ||
| 330 | 154 | if (ActionTypes.SAVE_PERMISSIONS_RESPONSE === action.type) { |
| 331 | 2 | this.state.permissions.loading = false; |
| 332 | 2 | this.state.permissions.success = action.data.success; |
| 333 | 2 | this.handleValidationErrors('permissions', action.data); |
| 334 | ||
| 335 | 2 | if (action.data.success) { |
| 336 | 1 | setTimeout(function () { |
| 337 | ||
| 338 | 1 | this.state.permissions.success = undefined; |
| 339 | 1 | this.emitChange(); |
| 340 | }.bind(this), 2500); | |
| 341 | ||
| 342 | 1 | this.resetValidationErrors('permissions'); |
| 343 | 1 | this.state.details.permissions = action.data.permissions; |
| 344 | } | |
| 345 | ||
| 346 | 2 | this.emitChange(); |
| 347 | } | |
| 348 | ||
| 349 | 154 | if (ActionTypes.DELETE === action.type) { |
| 350 | 2 | this.state.delete.loading = true; |
| 351 | 2 | this.emitChange(); |
| 352 | } | |
| 353 | ||
| 354 | 154 | if (ActionTypes.DELETE_RESPONSE === action.type) { |
| 355 | 2 | this.state.delete.loading = false; |
| 356 | 2 | this.handleValidationErrors('delete', action.data); |
| 357 | ||
| 358 | 2 | if (action.data.success) { |
| 359 | 1 | this.resetValidationErrors('delete'); |
| 360 | } | |
| 361 | else { | |
| 362 | 1 | setTimeout(function () { |
| 363 | ||
| 364 | 1 | this.state.delete.error = undefined; |
| 365 | 1 | this.emitChange(); |
| 366 | }.bind(this), 2500); | |
| 367 | } | |
| 368 | ||
| 369 | 2 | this.emitChange(); |
| 370 | } | |
| 371 | } | |
| 372 | }); | |
| 373 | ||
| 374 | ||
| 375 | 1 | module.exports = Store; |
| 376 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../constants/AdminGroup'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | results: { | |
| 16 | hydrated: false, | |
| 17 | loading: false, | |
| 18 | success: false, | |
| 19 | error: undefined, | |
| 20 | data: [], | |
| 21 | pages: {}, | |
| 22 | items: {} | |
| 23 | }, | |
| 24 | createNew: { | |
| 25 | show: false, | |
| 26 | loading: false, | |
| 27 | error: undefined, | |
| 28 | hasError: {}, | |
| 29 | help: {}, | |
| 30 | _id: undefined, | |
| 31 | name: undefined | |
| 32 | }, | |
| 33 | details: { | |
| 34 | hydrated: false, | |
| 35 | fetchFailure: false, | |
| 36 | loading: false, | |
| 37 | success: false, | |
| 38 | error: undefined, | |
| 39 | hasError: {}, | |
| 40 | help: {}, | |
| 41 | _id: undefined, | |
| 42 | name: undefined, | |
| 43 | permissions: {} | |
| 44 | }, | |
| 45 | permissions: { | |
| 46 | loading: false, | |
| 47 | success: false, | |
| 48 | error: undefined | |
| 49 | }, | |
| 50 | delete: { | |
| 51 | loading: false, | |
| 52 | error: undefined | |
| 53 | } | |
| 54 | }, | |
| 55 | getState: function () { | |
| 56 | ||
| 57 | 1 | return this.state; |
| 58 | }, | |
| 59 | getResults: function () { | |
| 60 | ||
| 61 | 20 | return this.state.results; |
| 62 | }, | |
| 63 | getCreateNew: function () { | |
| 64 | ||
| 65 | 17 | return this.state.createNew; |
| 66 | }, | |
| 67 | getDetails: function () { | |
| 68 | ||
| 69 | 15 | return this.state.details; |
| 70 | }, | |
| 71 | getPermissions: function () { | |
| 72 | ||
| 73 | 10 | return this.state.permissions; |
| 74 | }, | |
| 75 | getDelete: function () { | |
| 76 | ||
| 77 | 10 | return this.state.delete; |
| 78 | }, | |
| 79 | reset: function () { | |
| 80 | ||
| 81 | 1 | this.state = { |
| 82 | results: CloneDeep(this.defaultState.results), | |
| 83 | createNew: CloneDeep(this.defaultState.createNew), | |
| 84 | details: CloneDeep(this.defaultState.details), | |
| 85 | permissions: CloneDeep(this.defaultState.permissions), | |
| 86 | delete: CloneDeep(this.defaultState.delete) | |
| 87 | }; | |
| 88 | }, | |
| 89 | resetResults: function () { | |
| 90 | ||
| 91 | 13 | this.state.results = CloneDeep(this.defaultState.results); |
| 92 | }, | |
| 93 | resetCreateNew: function () { | |
| 94 | ||
| 95 | 12 | this.state.createNew = CloneDeep(this.defaultState.createNew); |
| 96 | }, | |
| 97 | resetDetails: function () { | |
| 98 | ||
| 99 | 5 | this.state.details = CloneDeep(this.defaultState.details); |
| 100 | }, | |
| 101 | resetPermissions: function () { | |
| 102 | ||
| 103 | 5 | this.state.permissions = CloneDeep(this.defaultState.permissions); |
| 104 | }, | |
| 105 | resetDelete: function () { | |
| 106 | ||
| 107 | 6 | this.state.delete = CloneDeep(this.defaultState.delete); |
| 108 | }, | |
| 109 | resetValidationErrors: function (pivot) { | |
| 110 | ||
| 111 | 4 | this.state[pivot].error = undefined; |
| 112 | 4 | this.state[pivot].hasError = {}; |
| 113 | 4 | this.state[pivot].help = {}; |
| 114 | }, | |
| 115 | handleValidationErrors: function (pivot, data) { | |
| 116 | ||
| 117 | 11 | var validation = ParseValidation(data.validation, data.message); |
| 118 | ||
| 119 | 11 | this.state[pivot].hasError = validation.hasError; |
| 120 | 11 | this.state[pivot].help = validation.help; |
| 121 | 11 | this.state[pivot].error = validation.error; |
| 122 | }, | |
| 123 | onDispatcherAction: function (payload) { | |
| 124 | ||
| 125 | 154 | var action = payload.action; |
| 126 | ||
| 127 | 154 | if (ActionTypes.GET_RESULTS === action.type) { |
| 128 | 1 | this.state.results.loading = true; |
| 129 | 1 | this.state.results.hydrated = false; |
| 130 | 1 | this.state.results.success = false; |
| 131 | 1 | this.emitChange(); |
| 132 | } | |
| 133 | ||
| 134 | 154 | if (ActionTypes.GET_RESULTS_RESPONSE === action.type) { |
| 135 | 1 | this.state.results.loading = false; |
| 136 | 1 | this.state.results.hydrated = true; |
| 137 | 1 | this.state.results.success = action.data.success; |
| 138 | 1 | this.state.results.data = action.data.data; |
| 139 | 1 | this.state.results.pages = action.data.pages; |
| 140 | 1 | this.state.results.items = action.data.items; |
| 141 | 1 | this.emitChange(); |
| 142 | } | |
| 143 | ||
| 144 | 154 | if (ActionTypes.SHOW_CREATE_NEW === action.type) { |
| 145 | 2 | this.resetCreateNew(); |
| 146 | 2 | this.state.createNew.show = true; |
| 147 | 2 | this.emitChange(); |
| 148 | } | |
| 149 | ||
| 150 | 154 | if (ActionTypes.HIDE_CREATE_NEW === action.type) { |
| 151 | 1 | this.state.createNew.show = false; |
| 152 | 1 | this.emitChange(); |
| 153 | } | |
| 154 | ||
| 155 | 154 | if (ActionTypes.CREATE_NEW === action.type) { |
| 156 | 1 | this.state.createNew.loading = true; |
| 157 | 1 | this.resetValidationErrors('createNew'); |
| 158 | 1 | this.emitChange(); |
| 159 | } | |
| 160 | ||
| 161 | 154 | if (ActionTypes.CREATE_NEW_RESPONSE === action.type) { |
| 162 | 2 | this.state.createNew.loading = false; |
| 163 | 2 | this.handleValidationErrors('createNew', action.data); |
| 164 | ||
| 165 | 2 | if (action.data.hasOwnProperty('_id')) { |
| 166 | 1 | this.resetCreateNew(); |
| 167 | } | |
| 168 | ||
| 169 | 2 | this.emitChange(); |
| 170 | } | |
| 171 | ||
| 172 | 154 | if (ActionTypes.GET_DETAILS === action.type) { |
| 173 | 1 | this.state.details.loading = true; |
| 174 | 1 | this.state.details.hydrated = false; |
| 175 | 1 | this.state.details.success = false; |
| 176 | 1 | this.emitChange(); |
| 177 | } | |
| 178 | ||
| 179 | 154 | if (ActionTypes.GET_DETAILS_RESPONSE === action.type) { |
| 180 | 1 | this.handleValidationErrors('details', action.data); |
| 181 | 1 | this.state.details.loading = false; |
| 182 | 1 | this.state.details.hydrated = true; |
| 183 | 1 | this.state.details.fetchFailure = action.data.fetchFailure; |
| 184 | 1 | this.state.details.success = action.data.success; |
| 185 | 1 | this.state.details._id = action.data._id; |
| 186 | 1 | this.state.details.name = action.data.name; |
| 187 | 1 | this.state.details.permissions = action.data.permissions; |
| 188 | 1 | this.emitChange(); |
| 189 | } | |
| 190 | ||
| 191 | 154 | if (ActionTypes.SAVE_DETAILS === action.type) { |
| 192 | 1 | this.state.details.loading = true; |
| 193 | 1 | this.emitChange(); |
| 194 | } | |
| 195 | ||
| 196 | 154 | if (ActionTypes.SAVE_DETAILS_RESPONSE === action.type) { |
| 197 | 2 | this.state.details.loading = false; |
| 198 | 2 | this.state.details.success = action.data.success; |
| 199 | 2 | this.handleValidationErrors('details', action.data); |
| 200 | ||
| 201 | 2 | if (action.data.success) { |
| 202 | 1 | setTimeout(function () { |
| 203 | ||
| 204 | 1 | this.state.details.success = undefined; |
| 205 | 1 | this.emitChange(); |
| 206 | }.bind(this), 2500); | |
| 207 | ||
| 208 | 1 | this.resetValidationErrors('details'); |
| 209 | 1 | this.state.details.name = action.data.name; |
| 210 | } | |
| 211 | ||
| 212 | 2 | this.emitChange(); |
| 213 | } | |
| 214 | ||
| 215 | 154 | if (ActionTypes.SAVE_PERMISSIONS === action.type) { |
| 216 | 1 | this.state.permissions.loading = true; |
| 217 | 1 | this.emitChange(); |
| 218 | } | |
| 219 | ||
| 220 | 154 | if (ActionTypes.SAVE_PERMISSIONS_RESPONSE === action.type) { |
| 221 | 2 | this.state.permissions.loading = false; |
| 222 | 2 | this.state.permissions.success = action.data.success; |
| 223 | 2 | this.handleValidationErrors('permissions', action.data); |
| 224 | ||
| 225 | 2 | if (action.data.success) { |
| 226 | 1 | setTimeout(function () { |
| 227 | ||
| 228 | 1 | this.state.permissions.success = undefined; |
| 229 | 1 | this.emitChange(); |
| 230 | }.bind(this), 2500); | |
| 231 | ||
| 232 | 1 | this.resetValidationErrors('permissions'); |
| 233 | 1 | this.state.details.permissions = action.data.permissions; |
| 234 | } | |
| 235 | ||
| 236 | 2 | this.emitChange(); |
| 237 | } | |
| 238 | ||
| 239 | 154 | if (ActionTypes.DELETE === action.type) { |
| 240 | 1 | this.state.delete.loading = true; |
| 241 | 1 | this.emitChange(); |
| 242 | } | |
| 243 | ||
| 244 | 154 | if (ActionTypes.DELETE_RESPONSE === action.type) { |
| 245 | 2 | this.state.delete.loading = false; |
| 246 | 2 | this.handleValidationErrors('delete', action.data); |
| 247 | ||
| 248 | 2 | if (action.data.success) { |
| 249 | 1 | this.resetValidationErrors('delete'); |
| 250 | } | |
| 251 | else { | |
| 252 | 1 | setTimeout(function () { |
| 253 | ||
| 254 | 1 | this.state.delete.error = undefined; |
| 255 | 1 | this.emitChange(); |
| 256 | }.bind(this), 2500); | |
| 257 | } | |
| 258 | ||
| 259 | 2 | this.emitChange(); |
| 260 | } | |
| 261 | } | |
| 262 | }); | |
| 263 | ||
| 264 | ||
| 265 | 1 | module.exports = Store; |
| 266 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../constants/Status'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | results: { | |
| 16 | hydrated: false, | |
| 17 | loading: false, | |
| 18 | success: false, | |
| 19 | error: undefined, | |
| 20 | data: [], | |
| 21 | pages: {}, | |
| 22 | items: {} | |
| 23 | }, | |
| 24 | createNew: { | |
| 25 | show: false, | |
| 26 | loading: false, | |
| 27 | error: undefined, | |
| 28 | hasError: {}, | |
| 29 | help: {}, | |
| 30 | _id: undefined, | |
| 31 | pivot: undefined, | |
| 32 | name: undefined | |
| 33 | }, | |
| 34 | details: { | |
| 35 | hydrated: false, | |
| 36 | fetchFailure: false, | |
| 37 | loading: false, | |
| 38 | success: false, | |
| 39 | error: undefined, | |
| 40 | hasError: {}, | |
| 41 | help: {}, | |
| 42 | _id: undefined, | |
| 43 | pivot: undefined, | |
| 44 | name: undefined | |
| 45 | }, | |
| 46 | delete: { | |
| 47 | loading: false, | |
| 48 | error: undefined | |
| 49 | } | |
| 50 | }, | |
| 51 | getState: function () { | |
| 52 | ||
| 53 | 1 | return this.state; |
| 54 | }, | |
| 55 | getResults: function () { | |
| 56 | ||
| 57 | 20 | return this.state.results; |
| 58 | }, | |
| 59 | getCreateNew: function () { | |
| 60 | ||
| 61 | 17 | return this.state.createNew; |
| 62 | }, | |
| 63 | getDetails: function () { | |
| 64 | ||
| 65 | 15 | return this.state.details; |
| 66 | }, | |
| 67 | getDelete: function () { | |
| 68 | ||
| 69 | 9 | return this.state.delete; |
| 70 | }, | |
| 71 | reset: function () { | |
| 72 | ||
| 73 | 1 | this.state = { |
| 74 | results: CloneDeep(this.defaultState.results), | |
| 75 | createNew: CloneDeep(this.defaultState.createNew), | |
| 76 | details: CloneDeep(this.defaultState.details), | |
| 77 | delete: CloneDeep(this.defaultState.delete) | |
| 78 | }; | |
| 79 | }, | |
| 80 | resetResults: function () { | |
| 81 | ||
| 82 | 13 | this.state.results = CloneDeep(this.defaultState.results); |
| 83 | }, | |
| 84 | resetCreateNew: function () { | |
| 85 | ||
| 86 | 12 | this.state.createNew = CloneDeep(this.defaultState.createNew); |
| 87 | }, | |
| 88 | resetDetails: function () { | |
| 89 | ||
| 90 | 5 | this.state.details = CloneDeep(this.defaultState.details); |
| 91 | }, | |
| 92 | resetDelete: function () { | |
| 93 | ||
| 94 | 5 | this.state.delete = CloneDeep(this.defaultState.delete); |
| 95 | }, | |
| 96 | resetValidationErrors: function (pivot) { | |
| 97 | ||
| 98 | 3 | this.state[pivot].error = undefined; |
| 99 | 3 | this.state[pivot].hasError = {}; |
| 100 | 3 | this.state[pivot].help = {}; |
| 101 | }, | |
| 102 | handleValidationErrors: function (pivot, data) { | |
| 103 | ||
| 104 | 9 | var validation = ParseValidation(data.validation, data.message); |
| 105 | ||
| 106 | 9 | this.state[pivot].hasError = validation.hasError; |
| 107 | 9 | this.state[pivot].help = validation.help; |
| 108 | 9 | this.state[pivot].error = validation.error; |
| 109 | }, | |
| 110 | onDispatcherAction: function (payload) { | |
| 111 | ||
| 112 | 154 | var action = payload.action; |
| 113 | ||
| 114 | 154 | if (ActionTypes.GET_RESULTS === action.type) { |
| 115 | 1 | this.state.results.loading = true; |
| 116 | 1 | this.state.results.hydrated = false; |
| 117 | 1 | this.state.results.success = false; |
| 118 | 1 | this.emitChange(); |
| 119 | } | |
| 120 | ||
| 121 | 154 | if (ActionTypes.GET_RESULTS_RESPONSE === action.type) { |
| 122 | 1 | this.state.results.loading = false; |
| 123 | 1 | this.state.results.hydrated = true; |
| 124 | 1 | this.state.results.success = action.data.success; |
| 125 | 1 | this.state.results.data = action.data.data; |
| 126 | 1 | this.state.results.pages = action.data.pages; |
| 127 | 1 | this.state.results.items = action.data.items; |
| 128 | 1 | this.emitChange(); |
| 129 | } | |
| 130 | ||
| 131 | 154 | if (ActionTypes.SHOW_CREATE_NEW === action.type) { |
| 132 | 2 | this.resetCreateNew(); |
| 133 | 2 | this.state.createNew.show = true; |
| 134 | 2 | this.emitChange(); |
| 135 | } | |
| 136 | ||
| 137 | 154 | if (ActionTypes.HIDE_CREATE_NEW === action.type) { |
| 138 | 1 | this.state.createNew.show = false; |
| 139 | 1 | this.emitChange(); |
| 140 | } | |
| 141 | ||
| 142 | 154 | if (ActionTypes.CREATE_NEW === action.type) { |
| 143 | 1 | this.state.createNew.loading = true; |
| 144 | 1 | this.resetValidationErrors('createNew'); |
| 145 | 1 | this.emitChange(); |
| 146 | } | |
| 147 | ||
| 148 | 154 | if (ActionTypes.CREATE_NEW_RESPONSE === action.type) { |
| 149 | 2 | this.state.createNew.loading = false; |
| 150 | 2 | this.handleValidationErrors('createNew', action.data); |
| 151 | ||
| 152 | 2 | if (action.data.hasOwnProperty('_id')) { |
| 153 | 1 | this.resetCreateNew(); |
| 154 | } | |
| 155 | ||
| 156 | 2 | this.emitChange(); |
| 157 | } | |
| 158 | ||
| 159 | 154 | if (ActionTypes.GET_DETAILS === action.type) { |
| 160 | 1 | this.state.details.loading = true; |
| 161 | 1 | this.state.details.hydrated = false; |
| 162 | 1 | this.state.details.success = false; |
| 163 | 1 | this.emitChange(); |
| 164 | } | |
| 165 | ||
| 166 | 154 | if (ActionTypes.GET_DETAILS_RESPONSE === action.type) { |
| 167 | 1 | this.handleValidationErrors('details', action.data); |
| 168 | 1 | this.state.details.loading = false; |
| 169 | 1 | this.state.details.hydrated = true; |
| 170 | 1 | this.state.details.fetchFailure = action.data.fetchFailure; |
| 171 | 1 | this.state.details.success = action.data.success; |
| 172 | 1 | this.state.details._id = action.data._id; |
| 173 | 1 | this.state.details.pivot = action.data.pivot; |
| 174 | 1 | this.state.details.name = action.data.name; |
| 175 | 1 | this.emitChange(); |
| 176 | } | |
| 177 | ||
| 178 | 154 | if (ActionTypes.SAVE_DETAILS === action.type) { |
| 179 | 1 | this.state.details.loading = true; |
| 180 | 1 | this.emitChange(); |
| 181 | } | |
| 182 | ||
| 183 | 154 | if (ActionTypes.SAVE_DETAILS_RESPONSE === action.type) { |
| 184 | 2 | this.state.details.loading = false; |
| 185 | 2 | this.state.details.success = action.data.success; |
| 186 | 2 | this.handleValidationErrors('details', action.data); |
| 187 | ||
| 188 | 2 | if (action.data.success) { |
| 189 | 1 | setTimeout(function () { |
| 190 | ||
| 191 | 1 | this.state.details.success = undefined; |
| 192 | 1 | this.emitChange(); |
| 193 | }.bind(this), 2500); | |
| 194 | ||
| 195 | 1 | this.resetValidationErrors('details'); |
| 196 | 1 | this.state.details.pivot = action.data.pivot; |
| 197 | 1 | this.state.details.name = action.data.name; |
| 198 | } | |
| 199 | ||
| 200 | 2 | this.emitChange(); |
| 201 | } | |
| 202 | ||
| 203 | 154 | if (ActionTypes.DELETE === action.type) { |
| 204 | 1 | this.state.delete.loading = true; |
| 205 | 1 | this.emitChange(); |
| 206 | } | |
| 207 | ||
| 208 | 154 | if (ActionTypes.DELETE_RESPONSE === action.type) { |
| 209 | 2 | this.state.delete.loading = false; |
| 210 | 2 | this.handleValidationErrors('delete', action.data); |
| 211 | ||
| 212 | 2 | if (action.data.success) { |
| 213 | 1 | this.resetValidationErrors('delete'); |
| 214 | } | |
| 215 | else { | |
| 216 | 1 | setTimeout(function () { |
| 217 | ||
| 218 | 1 | this.state.delete.error = undefined; |
| 219 | 1 | this.emitChange(); |
| 220 | }.bind(this), 2500); | |
| 221 | } | |
| 222 | ||
| 223 | 2 | this.emitChange(); |
| 224 | } | |
| 225 | } | |
| 226 | }); | |
| 227 | ||
| 228 | ||
| 229 | 1 | module.exports = Store; |
| 230 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../constants/User'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | results: { | |
| 16 | hydrated: false, | |
| 17 | loading: false, | |
| 18 | success: false, | |
| 19 | error: undefined, | |
| 20 | data: [], | |
| 21 | pages: {}, | |
| 22 | items: {} | |
| 23 | }, | |
| 24 | createNew: { | |
| 25 | show: false, | |
| 26 | loading: false, | |
| 27 | error: undefined, | |
| 28 | hasError: {}, | |
| 29 | help: {}, | |
| 30 | _id: undefined, | |
| 31 | username: undefined, | |
| 32 | email: undefined, | |
| 33 | password: undefined | |
| 34 | }, | |
| 35 | identity: { | |
| 36 | hydrated: false, | |
| 37 | fetchFailure: false, | |
| 38 | loading: false, | |
| 39 | success: false, | |
| 40 | error: undefined, | |
| 41 | hasError: {}, | |
| 42 | help: {}, | |
| 43 | _id: undefined, | |
| 44 | isActive: undefined, | |
| 45 | username: undefined, | |
| 46 | email: undefined, | |
| 47 | roles: {} | |
| 48 | }, | |
| 49 | password: { | |
| 50 | loading: false, | |
| 51 | success: false, | |
| 52 | error: undefined, | |
| 53 | hasError: {}, | |
| 54 | help: {} | |
| 55 | }, | |
| 56 | delete: { | |
| 57 | loading: false, | |
| 58 | error: undefined | |
| 59 | } | |
| 60 | }, | |
| 61 | getState: function () { | |
| 62 | ||
| 63 | 1 | return this.state; |
| 64 | }, | |
| 65 | getResults: function () { | |
| 66 | ||
| 67 | 14 | return this.state.results; |
| 68 | }, | |
| 69 | getCreateNew: function () { | |
| 70 | ||
| 71 | 17 | return this.state.createNew; |
| 72 | }, | |
| 73 | getIdentity: function () { | |
| 74 | ||
| 75 | 15 | return this.state.identity; |
| 76 | }, | |
| 77 | getPassword: function () { | |
| 78 | ||
| 79 | 10 | return this.state.password; |
| 80 | }, | |
| 81 | getDelete: function () { | |
| 82 | ||
| 83 | 9 | return this.state.delete; |
| 84 | }, | |
| 85 | reset: function () { | |
| 86 | ||
| 87 | 1 | this.state = { |
| 88 | results: CloneDeep(this.defaultState.results), | |
| 89 | createNew: CloneDeep(this.defaultState.createNew), | |
| 90 | identity: CloneDeep(this.defaultState.identity), | |
| 91 | password: CloneDeep(this.defaultState.password), | |
| 92 | delete: CloneDeep(this.defaultState.delete) | |
| 93 | }; | |
| 94 | }, | |
| 95 | resetResults: function () { | |
| 96 | ||
| 97 | 9 | this.state.results = CloneDeep(this.defaultState.results); |
| 98 | }, | |
| 99 | resetCreateNew: function () { | |
| 100 | ||
| 101 | 12 | this.state.createNew = CloneDeep(this.defaultState.createNew); |
| 102 | }, | |
| 103 | resetIdentity: function () { | |
| 104 | ||
| 105 | 5 | this.state.identity = CloneDeep(this.defaultState.identity); |
| 106 | }, | |
| 107 | resetPassword: function () { | |
| 108 | ||
| 109 | 5 | this.state.password = CloneDeep(this.defaultState.password); |
| 110 | }, | |
| 111 | resetDelete: function () { | |
| 112 | ||
| 113 | 5 | this.state.delete = CloneDeep(this.defaultState.delete); |
| 114 | }, | |
| 115 | resetValidationErrors: function (pivot) { | |
| 116 | ||
| 117 | 4 | this.state[pivot].error = undefined; |
| 118 | 4 | this.state[pivot].hasError = {}; |
| 119 | 4 | this.state[pivot].help = {}; |
| 120 | }, | |
| 121 | handleValidationErrors: function (pivot, data) { | |
| 122 | ||
| 123 | 11 | var validation = ParseValidation(data.validation, data.message); |
| 124 | ||
| 125 | 11 | this.state[pivot].hasError = validation.hasError; |
| 126 | 11 | this.state[pivot].help = validation.help; |
| 127 | 11 | this.state[pivot].error = validation.error; |
| 128 | }, | |
| 129 | onDispatcherAction: function (payload) { | |
| 130 | ||
| 131 | 154 | var action = payload.action; |
| 132 | ||
| 133 | 154 | if (ActionTypes.GET_RESULTS === action.type) { |
| 134 | 1 | this.state.results.loading = true; |
| 135 | 1 | this.state.results.hydrated = false; |
| 136 | 1 | this.state.results.success = false; |
| 137 | 1 | this.emitChange(); |
| 138 | } | |
| 139 | ||
| 140 | 154 | if (ActionTypes.SHOW_CREATE_NEW === action.type) { |
| 141 | 2 | this.resetCreateNew(); |
| 142 | 2 | this.state.createNew.show = true; |
| 143 | 2 | this.emitChange(); |
| 144 | } | |
| 145 | ||
| 146 | 154 | if (ActionTypes.HIDE_CREATE_NEW === action.type) { |
| 147 | 1 | this.state.createNew.show = false; |
| 148 | 1 | this.emitChange(); |
| 149 | } | |
| 150 | ||
| 151 | 154 | if (ActionTypes.CREATE_NEW === action.type) { |
| 152 | 1 | this.state.createNew.loading = true; |
| 153 | 1 | this.resetValidationErrors('createNew'); |
| 154 | 1 | this.emitChange(); |
| 155 | } | |
| 156 | ||
| 157 | 154 | if (ActionTypes.CREATE_NEW_RESPONSE === action.type) { |
| 158 | 2 | this.state.createNew.loading = false; |
| 159 | 2 | this.handleValidationErrors('createNew', action.data); |
| 160 | ||
| 161 | 2 | if (action.data.hasOwnProperty('_id')) { |
| 162 | 1 | this.resetCreateNew(); |
| 163 | } | |
| 164 | ||
| 165 | 2 | this.emitChange(); |
| 166 | } | |
| 167 | ||
| 168 | 154 | if (ActionTypes.GET_RESULTS_RESPONSE === action.type) { |
| 169 | 1 | this.state.results.loading = false; |
| 170 | 1 | this.state.results.hydrated = true; |
| 171 | 1 | this.state.results.success = action.data.success; |
| 172 | 1 | this.state.results.data = action.data.data; |
| 173 | 1 | this.state.results.pages = action.data.pages; |
| 174 | 1 | this.state.results.items = action.data.items; |
| 175 | 1 | this.emitChange(); |
| 176 | } | |
| 177 | ||
| 178 | 154 | if (ActionTypes.GET_IDENTITY === action.type) { |
| 179 | 1 | this.state.identity.loading = true; |
| 180 | 1 | this.state.identity.hydrated = false; |
| 181 | 1 | this.state.identity.success = false; |
| 182 | 1 | this.emitChange(); |
| 183 | } | |
| 184 | ||
| 185 | 154 | if (ActionTypes.GET_IDENTITY_RESPONSE === action.type) { |
| 186 | 1 | this.handleValidationErrors('identity', action.data); |
| 187 | 1 | this.state.identity.loading = false; |
| 188 | 1 | this.state.identity.hydrated = true; |
| 189 | 1 | this.state.identity.fetchFailure = action.data.fetchFailure; |
| 190 | 1 | this.state.identity.success = action.data.success; |
| 191 | 1 | this.state.identity._id = action.data._id; |
| 192 | 1 | this.state.identity.isActive = action.data.isActive; |
| 193 | 1 | this.state.identity.username = action.data.username; |
| 194 | 1 | this.state.identity.email = action.data.email; |
| 195 | 1 | this.state.identity.roles = action.data.roles; |
| 196 | 1 | this.emitChange(); |
| 197 | } | |
| 198 | ||
| 199 | 154 | if (ActionTypes.SAVE_IDENTITY === action.type) { |
| 200 | 1 | this.state.identity.loading = true; |
| 201 | 1 | this.emitChange(); |
| 202 | } | |
| 203 | ||
| 204 | 154 | if (ActionTypes.SAVE_IDENTITY_RESPONSE === action.type) { |
| 205 | 2 | this.state.identity.loading = false; |
| 206 | 2 | this.state.identity.success = action.data.success; |
| 207 | 2 | this.handleValidationErrors('identity', action.data); |
| 208 | ||
| 209 | 2 | if (action.data.success) { |
| 210 | 1 | setTimeout(function () { |
| 211 | ||
| 212 | 1 | this.state.identity.success = undefined; |
| 213 | 1 | this.emitChange(); |
| 214 | }.bind(this), 2500); | |
| 215 | ||
| 216 | 1 | this.resetValidationErrors('identity'); |
| 217 | 1 | this.state.identity.isActive = action.data.isActive; |
| 218 | 1 | this.state.identity.username = action.data.username; |
| 219 | 1 | this.state.identity.email = action.data.email; |
| 220 | } | |
| 221 | ||
| 222 | 2 | this.emitChange(); |
| 223 | } | |
| 224 | ||
| 225 | 154 | if (ActionTypes.SAVE_PASSWORD === action.type) { |
| 226 | 1 | this.state.password.loading = true; |
| 227 | 1 | this.emitChange(); |
| 228 | } | |
| 229 | ||
| 230 | 154 | if (ActionTypes.SAVE_PASSWORD_RESPONSE === action.type) { |
| 231 | 2 | this.state.password.loading = false; |
| 232 | 2 | this.state.password.success = action.data.success; |
| 233 | 2 | this.handleValidationErrors('password', action.data); |
| 234 | ||
| 235 | 2 | if (action.data.success) { |
| 236 | 1 | setTimeout(function () { |
| 237 | ||
| 238 | 1 | this.state.password.success = undefined; |
| 239 | 1 | this.emitChange(); |
| 240 | }.bind(this), 2500); | |
| 241 | ||
| 242 | 1 | this.resetValidationErrors('password'); |
| 243 | } | |
| 244 | ||
| 245 | 2 | this.emitChange(); |
| 246 | } | |
| 247 | ||
| 248 | 154 | if (ActionTypes.DELETE === action.type) { |
| 249 | 1 | this.state.delete.loading = true; |
| 250 | 1 | this.emitChange(); |
| 251 | } | |
| 252 | ||
| 253 | 154 | if (ActionTypes.DELETE_RESPONSE === action.type) { |
| 254 | 2 | this.state.delete.loading = false; |
| 255 | 2 | this.handleValidationErrors('delete', action.data); |
| 256 | ||
| 257 | 2 | if (action.data.success) { |
| 258 | 1 | this.resetValidationErrors('delete'); |
| 259 | } | |
| 260 | else { | |
| 261 | 1 | setTimeout(function () { |
| 262 | ||
| 263 | 1 | this.state.delete.error = undefined; |
| 264 | 1 | this.emitChange(); |
| 265 | }.bind(this), 2500); | |
| 266 | } | |
| 267 | ||
| 268 | 2 | this.emitChange(); |
| 269 | } | |
| 270 | } | |
| 271 | }); | |
| 272 | ||
| 273 | ||
| 274 | 1 | module.exports = Store; |
| 275 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var Constants = require('./Constants'); |
| 3 | 1 | var Fetch = require('../../helpers/jsonFetch'); |
| 4 | ||
| 5 | ||
| 6 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 7 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | 1 | var dispatch = Dispatcher.handleAction; |
| 10 | ||
| 11 | ||
| 12 | 1 | var Actions = { |
| 13 | sendMessage: function (data) { | |
| 14 | ||
| 15 | 2 | dispatch(VIEW_ACTION, ActionTypes.SEND_MESSAGE, data); |
| 16 | ||
| 17 | 2 | var request = { |
| 18 | method: 'POST', | |
| 19 | url: '/api/contact', | |
| 20 | data: data | |
| 21 | }; | |
| 22 | ||
| 23 | 2 | Fetch(request, function (err, response) { |
| 24 | ||
| 25 | 2 | if (!err) { |
| 26 | 1 | response.success = true; |
| 27 | } | |
| 28 | ||
| 29 | 2 | dispatch(SERVER_ACTION, ActionTypes.SEND_MESSAGE_RESPONSE, response); |
| 30 | }); | |
| 31 | } | |
| 32 | }; | |
| 33 | ||
| 34 | ||
| 35 | 1 | module.exports = Actions; |
| 36 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'SEND_MESSAGE', | |
| 9 | 'SEND_MESSAGE_RESPONSE' | |
| 10 | ]) | |
| 11 | }; | |
| 12 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/contact/Form.jsx | 1 | |
| 2 | client/pages/contact/Form.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/contact/Form.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../components/form/ControlGroup'); | client/pages/contact/Form.jsx | 2 |
| 5 | 1 | var TextControl = require('../../components/form/TextControl'); | client/pages/contact/Form.jsx | 3 |
| 6 | 1 | var TextareaControl = require('../../components/form/TextareaControl'); | client/pages/contact/Form.jsx | 4 |
| 7 | 1 | var Button = require('../../components/form/Button'); | client/pages/contact/Form.jsx | 5 |
| 8 | 1 | var Spinner = require('../../components/form/Spinner'); | client/pages/contact/Form.jsx | 6 |
| 9 | 1 | var Actions = require('./Actions'); | client/pages/contact/Form.jsx | 7 |
| 10 | 1 | var Store = require('./Store'); | client/pages/contact/Form.jsx | 8 |
| 11 | client/pages/contact/Form.jsx | 8 | ||
| 12 | 1 | var Component = React.createClass({ | client/pages/contact/Form.jsx | 11 |
| 13 | displayName: 'Component', | client/pages/contact/Form.jsx | 11 | |
| 14 | client/pages/contact/Form.jsx | 11 | ||
| 15 | mixins: [React.addons.LinkedStateMixin], | client/pages/contact/Form.jsx | 12 | |
| 16 | getInitialState: function getInitialState() { | client/pages/contact/Form.jsx | 13 | |
| 17 | client/pages/contact/Form.jsx | 13 | ||
| 18 | 8 | Store.reset(); | client/pages/contact/Form.jsx | 15 |
| 19 | 8 | return Store.getState(); | client/pages/contact/Form.jsx | 16 |
| 20 | }, | client/pages/contact/Form.jsx | 16 | |
| 21 | componentDidMount: function componentDidMount() { | client/pages/contact/Form.jsx | 18 | |
| 22 | client/pages/contact/Form.jsx | 18 | ||
| 23 | 8 | Store.addChangeListener(this.onStoreChange); | client/pages/contact/Form.jsx | 20 |
| 24 | 8 | this.refs.nameControl.refs.inputField.getDOMNode().focus(); | client/pages/contact/Form.jsx | 21 |
| 25 | }, | client/pages/contact/Form.jsx | 21 | |
| 26 | componentWillUnmount: function componentWillUnmount() { | client/pages/contact/Form.jsx | 23 | |
| 27 | client/pages/contact/Form.jsx | 23 | ||
| 28 | 2 | Store.removeChangeListener(this.onStoreChange); | client/pages/contact/Form.jsx | 25 |
| 29 | }, | client/pages/contact/Form.jsx | 25 | |
| 30 | onStoreChange: function onStoreChange() { | client/pages/contact/Form.jsx | 27 | |
| 31 | client/pages/contact/Form.jsx | 27 | ||
| 32 | 17 | this.setState(Store.getState()); | client/pages/contact/Form.jsx | 29 |
| 33 | }, | client/pages/contact/Form.jsx | 29 | |
| 34 | handleSubmit: function handleSubmit(event) { | client/pages/contact/Form.jsx | 31 | |
| 35 | client/pages/contact/Form.jsx | 31 | ||
| 36 | 1 | event.preventDefault(); | client/pages/contact/Form.jsx | 33 |
| 37 | 1 | event.stopPropagation(); | client/pages/contact/Form.jsx | 34 |
| 38 | client/pages/contact/Form.jsx | 34 | ||
| 39 | 1 | Actions.sendMessage({ | client/pages/contact/Form.jsx | 36 |
| 40 | name: this.state.name, | client/pages/contact/Form.jsx | 37 | |
| 41 | email: this.state.email, | client/pages/contact/Form.jsx | 38 | |
| 42 | message: this.state.message | client/pages/contact/Form.jsx | 39 | |
| 43 | }); | client/pages/contact/Form.jsx | 39 | |
| 44 | }, | client/pages/contact/Form.jsx | 40 | |
| 45 | render: function render() { | client/pages/contact/Form.jsx | 42 | |
| 46 | client/pages/contact/Form.jsx | 42 | ||
| 47 | 25 | var alerts = []; | client/pages/contact/Form.jsx | 44 |
| 48 | 25 | if (this.state.success) { | client/pages/contact/Form.jsx | 45 |
| 49 | 5 | alerts.push(React.createElement( | client/pages/contact/Form.jsx | 46 |
| 50 | 'div', | client/pages/contact/Form.jsx | 46 | |
| 51 | { key: 'success', className: 'alert alert-success' }, | client/pages/contact/Form.jsx | 46 | |
| 52 | 'Success. We have received your message.' | client/pages/contact/Form.jsx | 46 | |
| 53 | )); | client/pages/contact/Form.jsx | 46 | |
| 54 | 20 | } else if (this.state.error) { | client/pages/contact/Form.jsx | 48 |
| 55 | 6 | alerts.push(React.createElement( | client/pages/contact/Form.jsx | 51 |
| 56 | 'div', | client/pages/contact/Form.jsx | 51 | |
| 57 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/contact/Form.jsx | 51 | |
| 58 | this.state.error | client/pages/contact/Form.jsx | 51 | |
| 59 | )); | client/pages/contact/Form.jsx | 52 | |
| 60 | } | client/pages/contact/Form.jsx | 53 | |
| 61 | client/pages/contact/Form.jsx | 54 | ||
| 62 | 25 | var formElements; | client/pages/contact/Form.jsx | 56 |
| 63 | 25 | if (!this.state.success) { | client/pages/contact/Form.jsx | 57 |
| 64 | 20 | formElements = React.createElement( | client/pages/contact/Form.jsx | 58 |
| 65 | 'fieldset', | client/pages/contact/Form.jsx | 58 | |
| 66 | null, | client/pages/contact/Form.jsx | 58 | |
| 67 | React.createElement(TextControl, { | client/pages/contact/Form.jsx | 58 | |
| 68 | name: 'name', | client/pages/contact/Form.jsx | 60 | |
| 69 | label: 'Your name', | client/pages/contact/Form.jsx | 61 | |
| 70 | ref: 'nameControl', | client/pages/contact/Form.jsx | 62 | |
| 71 | hasError: this.state.hasError.name, | client/pages/contact/Form.jsx | 63 | |
| 72 | valueLink: this.linkState('name'), | client/pages/contact/Form.jsx | 64 | |
| 73 | help: this.state.help.name, | client/pages/contact/Form.jsx | 65 | |
| 74 | disabled: this.state.loading | client/pages/contact/Form.jsx | 66 | |
| 75 | }), | client/pages/contact/Form.jsx | 66 | |
| 76 | React.createElement(TextControl, { | client/pages/contact/Form.jsx | 67 | |
| 77 | name: 'email', | client/pages/contact/Form.jsx | 69 | |
| 78 | label: 'Your email', | client/pages/contact/Form.jsx | 70 | |
| 79 | hasError: this.state.hasError.email, | client/pages/contact/Form.jsx | 71 | |
| 80 | valueLink: this.linkState('email'), | client/pages/contact/Form.jsx | 72 | |
| 81 | help: this.state.help.email, | client/pages/contact/Form.jsx | 73 | |
| 82 | disabled: this.state.loading | client/pages/contact/Form.jsx | 74 | |
| 83 | }), | client/pages/contact/Form.jsx | 74 | |
| 84 | React.createElement(TextareaControl, { | client/pages/contact/Form.jsx | 75 | |
| 85 | name: 'message', | client/pages/contact/Form.jsx | 77 | |
| 86 | label: 'Message', | client/pages/contact/Form.jsx | 78 | |
| 87 | rows: '5', | client/pages/contact/Form.jsx | 79 | |
| 88 | hasError: this.state.hasError.message, | client/pages/contact/Form.jsx | 80 | |
| 89 | valueLink: this.linkState('message'), | client/pages/contact/Form.jsx | 81 | |
| 90 | help: this.state.help.message, | client/pages/contact/Form.jsx | 82 | |
| 91 | disabled: this.state.loading | client/pages/contact/Form.jsx | 83 | |
| 92 | }), | client/pages/contact/Form.jsx | 83 | |
| 93 | React.createElement( | client/pages/contact/Form.jsx | 84 | |
| 94 | ControlGroup, | client/pages/contact/Form.jsx | 85 | |
| 95 | { hideLabel: true, hideHelp: true }, | client/pages/contact/Form.jsx | 85 | |
| 96 | React.createElement( | client/pages/contact/Form.jsx | 85 | |
| 97 | Button, | client/pages/contact/Form.jsx | 86 | |
| 98 | { | client/pages/contact/Form.jsx | 86 | |
| 99 | type: 'submit', | client/pages/contact/Form.jsx | 87 | |
| 100 | inputClasses: { 'btn-primary': true }, | client/pages/contact/Form.jsx | 88 | |
| 101 | disabled: this.state.loading }, | client/pages/contact/Form.jsx | 89 | |
| 102 | 'Send message', | client/pages/contact/Form.jsx | 89 | |
| 103 | React.createElement(Spinner, { space: 'left', show: this.state.loading }) | client/pages/contact/Form.jsx | 89 | |
| 104 | ) | client/pages/contact/Form.jsx | 92 | |
| 105 | ) | client/pages/contact/Form.jsx | 93 | |
| 106 | ); | client/pages/contact/Form.jsx | 94 | |
| 107 | } | client/pages/contact/Form.jsx | 95 | |
| 108 | client/pages/contact/Form.jsx | 96 | ||
| 109 | 25 | return React.createElement( | client/pages/contact/Form.jsx | 98 |
| 110 | 'section', | client/pages/contact/Form.jsx | 99 | |
| 111 | null, | client/pages/contact/Form.jsx | 99 | |
| 112 | React.createElement( | client/pages/contact/Form.jsx | 99 | |
| 113 | 'h1', | client/pages/contact/Form.jsx | 100 | |
| 114 | { className: 'page-header' }, | client/pages/contact/Form.jsx | 100 | |
| 115 | 'Send a message' | client/pages/contact/Form.jsx | 100 | |
| 116 | ), | client/pages/contact/Form.jsx | 100 | |
| 117 | React.createElement( | client/pages/contact/Form.jsx | 100 | |
| 118 | 'form', | client/pages/contact/Form.jsx | 101 | |
| 119 | { onSubmit: this.handleSubmit }, | client/pages/contact/Form.jsx | 101 | |
| 120 | alerts, | client/pages/contact/Form.jsx | 101 | |
| 121 | formElements | client/pages/contact/Form.jsx | 102 | |
| 122 | ) | client/pages/contact/Form.jsx | 103 | |
| 123 | ); | client/pages/contact/Form.jsx | 104 | |
| 124 | } | client/pages/contact/Form.jsx | 106 | |
| 125 | }); | client/pages/contact/Form.jsx | 107 | |
| 126 | client/pages/contact/Form.jsx | 108 | ||
| 127 | 1 | module.exports = Component; | client/pages/contact/Form.jsx | 111 |
| 128 | client/pages/contact/Form.jsx | 111 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('./Constants'); |
| 5 | 1 | var ParseValidation = require('../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | loading: false, | |
| 16 | success: false, | |
| 17 | error: undefined, | |
| 18 | hasError: {}, | |
| 19 | help: {} | |
| 20 | }, | |
| 21 | getState: function () { | |
| 22 | ||
| 23 | 30 | return this.state; |
| 24 | }, | |
| 25 | reset: function () { | |
| 26 | ||
| 27 | 9 | this.state = CloneDeep(this.defaultState); |
| 28 | }, | |
| 29 | onDispatcherAction: function (payload) { | |
| 30 | ||
| 31 | 157 | var action = payload.action; |
| 32 | ||
| 33 | 157 | if (ActionTypes.SEND_MESSAGE === action.type) { |
| 34 | 2 | this.state.loading = true; |
| 35 | 2 | this.state.success = false; |
| 36 | 2 | this.state.error = undefined; |
| 37 | 2 | this.state.hasError = {}; |
| 38 | 2 | this.state.help = {}; |
| 39 | 2 | this.emitChange(); |
| 40 | } | |
| 41 | ||
| 42 | 157 | if (ActionTypes.SEND_MESSAGE_RESPONSE === action.type) { |
| 43 | 5 | var validation = ParseValidation(action.data.validation, action.data.message); |
| 44 | ||
| 45 | 5 | this.state.loading = false; |
| 46 | 5 | this.state.success = action.data.success; |
| 47 | 5 | this.state.hasError = validation.hasError; |
| 48 | 5 | this.state.help = validation.help; |
| 49 | 5 | this.state.error = validation.error; |
| 50 | ||
| 51 | 5 | this.emitChange(); |
| 52 | } | |
| 53 | } | |
| 54 | }); | |
| 55 | ||
| 56 | ||
| 57 | 1 | module.exports = Store; |
| 58 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/contact/index.jsx | 1 | |
| 2 | 'use strict'; | client/pages/contact/index.jsx | 2 | |
| 3 | client/pages/contact/index.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/contact/index.jsx | 2 |
| 5 | 1 | var FormView = require('./Form'); | client/pages/contact/index.jsx | 3 |
| 6 | client/pages/contact/index.jsx | 3 | ||
| 7 | 1 | var App = { | client/pages/contact/index.jsx | 6 |
| 8 | blastoff: function blastoff() { | client/pages/contact/index.jsx | 7 | |
| 9 | client/pages/contact/index.jsx | 7 | ||
| 10 | 1 | this.mainElement = React.render(React.createElement(FormView, null), window.document.getElementById('app-mount')); | client/pages/contact/index.jsx | 9 |
| 11 | } | client/pages/contact/index.jsx | 12 | |
| 12 | }; | client/pages/contact/index.jsx | 13 | |
| 13 | client/pages/contact/index.jsx | 14 | ||
| 14 | 1 | module.exports = App; | client/pages/contact/index.jsx | 17 |
| 15 | client/pages/contact/index.jsx | 17 | ||
| 16 | /* $lab:coverage:off$ */ | client/pages/contact/index.jsx | 17 | |
| 17 | if (!module.parent) { | client/pages/contact/index.jsx | 21 | |
| 18 | window.app = App; | client/pages/contact/index.jsx | 22 | |
| 19 | App.blastoff(); | client/pages/contact/index.jsx | 23 | |
| 20 | } | client/pages/contact/index.jsx | 23 | |
| 21 | /* $lab:coverage:on$ */ | client/pages/contact/index.jsx | 24 | |
| 22 | client/pages/contact/index.jsx | 24 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('./Constants'); |
| 4 | 1 | var Fetch = require('../../helpers/jsonFetch'); |
| 5 | 1 | var RedirectActions = require('../../actions/Redirect'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 9 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 10 | 1 | var Types = Constants.ActionTypes; |
| 11 | 1 | var dispatch = Dispatcher.handleAction; |
| 12 | ||
| 13 | ||
| 14 | 1 | var Actions = { |
| 15 | forgot: function (data) { | |
| 16 | ||
| 17 | 2 | dispatch(VIEW_ACTION, Types.FORGOT, data); |
| 18 | ||
| 19 | 2 | var request = { |
| 20 | method: 'POST', | |
| 21 | url: '/api/login/forgot', | |
| 22 | data: data | |
| 23 | }; | |
| 24 | ||
| 25 | 2 | Fetch(request, function (err, response) { |
| 26 | ||
| 27 | 2 | if (!err) { |
| 28 | 1 | response.success = true; |
| 29 | } | |
| 30 | ||
| 31 | 2 | dispatch(SERVER_ACTION, Types.FORGOT_RESPONSE, response); |
| 32 | }); | |
| 33 | }, | |
| 34 | login: function (data) { | |
| 35 | ||
| 36 | 4 | dispatch(VIEW_ACTION, Types.LOGIN, data); |
| 37 | ||
| 38 | 4 | var request = { |
| 39 | method: 'POST', | |
| 40 | url: '/api/login', | |
| 41 | data: data | |
| 42 | }; | |
| 43 | ||
| 44 | 4 | Fetch(request, function (err, response) { |
| 45 | ||
| 46 | 4 | if (!err) { |
| 47 | 3 | var returnUrl = window.localStorage.getItem('returnUrl'); |
| 48 | ||
| 49 | 3 | if (returnUrl) { |
| 50 | 1 | RedirectActions.clearReturnUrl(); |
| 51 | 1 | window.location.href = returnUrl; |
| 52 | } | |
| 53 | 2 | else if (response.user.roles.admin) { |
| 54 | 1 | window.location.href = '/admin'; |
| 55 | } | |
| 56 | else { | |
| 57 | 1 | window.location.href = '/account'; |
| 58 | } | |
| 59 | ||
| 60 | 3 | response.success = true; |
| 61 | } | |
| 62 | ||
| 63 | 4 | dispatch(SERVER_ACTION, Types.LOGIN_RESPONSE, response); |
| 64 | }); | |
| 65 | }, | |
| 66 | logout: function (data) { | |
| 67 | ||
| 68 | 2 | dispatch(VIEW_ACTION, Types.LOGOUT, data); |
| 69 | ||
| 70 | 2 | var request = { |
| 71 | method: 'DELETE', | |
| 72 | url: '/api/logout', | |
| 73 | data: data, | |
| 74 | useAuth: true | |
| 75 | }; | |
| 76 | ||
| 77 | 2 | Fetch(request, function (err, response) { |
| 78 | ||
| 79 | 2 | if (!err) { |
| 80 | 1 | response.success = true; |
| 81 | } | |
| 82 | else { | |
| 83 | 1 | response.error = err.message; |
| 84 | } | |
| 85 | ||
| 86 | 2 | dispatch(SERVER_ACTION, Types.LOGOUT_RESPONSE, response); |
| 87 | }); | |
| 88 | }, | |
| 89 | reset: function (data) { | |
| 90 | ||
| 91 | 2 | dispatch(VIEW_ACTION, Types.RESET, data); |
| 92 | ||
| 93 | 2 | var request = { |
| 94 | method: 'POST', | |
| 95 | url: '/api/login/reset', | |
| 96 | data: data | |
| 97 | }; | |
| 98 | ||
| 99 | 2 | Fetch(request, function (err, response) { |
| 100 | ||
| 101 | 2 | if (!err) { |
| 102 | 1 | response.success = true; |
| 103 | } | |
| 104 | ||
| 105 | 2 | dispatch(SERVER_ACTION, Types.RESET_RESPONSE, response); |
| 106 | }); | |
| 107 | } | |
| 108 | }; | |
| 109 | ||
| 110 | ||
| 111 | 1 | module.exports = Actions; |
| 112 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'FORGOT', | |
| 9 | 'FORGOT_RESPONSE', | |
| 10 | 'LOGIN', | |
| 11 | 'LOGIN_RESPONSE', | |
| 12 | 'LOGOUT', | |
| 13 | 'LOGOUT_RESPONSE', | |
| 14 | 'RESET', | |
| 15 | 'RESET_RESPONSE' | |
| 16 | ]) | |
| 17 | }; | |
| 18 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/login/Routes.jsx | 1 | |
| 2 | client/pages/login/Routes.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/login/Routes.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/login/Routes.jsx | 2 |
| 5 | 1 | var App = require('./components/App'); | client/pages/login/Routes.jsx | 3 |
| 6 | 1 | var Home = require('./components/Home'); | client/pages/login/Routes.jsx | 4 |
| 7 | 1 | var NotFound = require('./components/NotFound'); | client/pages/login/Routes.jsx | 5 |
| 8 | 1 | var Logout = require('./components/Logout'); | client/pages/login/Routes.jsx | 6 |
| 9 | 1 | var Forgot = require('./components/Forgot'); | client/pages/login/Routes.jsx | 7 |
| 10 | 1 | var Reset = require('./components/Reset'); | client/pages/login/Routes.jsx | 8 |
| 11 | client/pages/login/Routes.jsx | 8 | ||
| 12 | 1 | var Route = ReactRouter.Route; | client/pages/login/Routes.jsx | 11 |
| 13 | 1 | var DefaultRoute = ReactRouter.DefaultRoute; | client/pages/login/Routes.jsx | 12 |
| 14 | 1 | var NotFoundRoute = ReactRouter.NotFoundRoute; | client/pages/login/Routes.jsx | 13 |
| 15 | client/pages/login/Routes.jsx | 13 | ||
| 16 | 1 | var Routes = React.createElement( | client/pages/login/Routes.jsx | 16 |
| 17 | Route, | client/pages/login/Routes.jsx | 17 | |
| 18 | { path: '/login', name: 'app', handler: App }, | client/pages/login/Routes.jsx | 17 | |
| 19 | React.createElement(DefaultRoute, { name: 'home', handler: Home }), | client/pages/login/Routes.jsx | 17 | |
| 20 | React.createElement(NotFoundRoute, { name: 'notFound', handler: NotFound }), | client/pages/login/Routes.jsx | 18 | |
| 21 | React.createElement(Route, { path: 'forgot', name: 'forgot', handler: Forgot }), | client/pages/login/Routes.jsx | 19 | |
| 22 | React.createElement(Route, { path: 'reset/:email/:key', name: 'reset', handler: Reset }), | client/pages/login/Routes.jsx | 21 | |
| 23 | React.createElement(Route, { path: 'logout', name: 'logout', handler: Logout }) | client/pages/login/Routes.jsx | 22 | |
| 24 | ); | client/pages/login/Routes.jsx | 23 | |
| 25 | client/pages/login/Routes.jsx | 25 | ||
| 26 | 1 | module.exports = Routes; | client/pages/login/Routes.jsx | 28 |
| 27 | client/pages/login/Routes.jsx | 28 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/login/index.jsx | 1 | |
| 2 | 'use strict'; | client/pages/login/index.jsx | 2 | |
| 3 | client/pages/login/index.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/login/index.jsx | 2 |
| 5 | 1 | var ReactRouter = require('react-router'); | client/pages/login/index.jsx | 3 |
| 6 | 1 | var Routes = require('./Routes'); | client/pages/login/index.jsx | 4 |
| 7 | client/pages/login/index.jsx | 4 | ||
| 8 | 1 | var HistoryLocation = ReactRouter.HistoryLocation; | client/pages/login/index.jsx | 7 |
| 9 | client/pages/login/index.jsx | 7 | ||
| 10 | 1 | var App = { | client/pages/login/index.jsx | 10 |
| 11 | blastoff: function blastoff() { | client/pages/login/index.jsx | 11 | |
| 12 | client/pages/login/index.jsx | 11 | ||
| 13 | 1 | var self = this; | client/pages/login/index.jsx | 13 |
| 14 | client/pages/login/index.jsx | 13 | ||
| 15 | 1 | ReactRouter.run(Routes, HistoryLocation, function (Handler) { | client/pages/login/index.jsx | 15 |
| 16 | client/pages/login/index.jsx | 15 | ||
| 17 | 1 | self.mainElement = React.render(React.createElement(Handler, null), window.document.getElementById('app-mount')); | client/pages/login/index.jsx | 17 |
| 18 | }); | client/pages/login/index.jsx | 20 | |
| 19 | } | client/pages/login/index.jsx | 21 | |
| 20 | }; | client/pages/login/index.jsx | 22 | |
| 21 | client/pages/login/index.jsx | 23 | ||
| 22 | 1 | module.exports = App; | client/pages/login/index.jsx | 26 |
| 23 | client/pages/login/index.jsx | 26 | ||
| 24 | /* $lab:coverage:off$ */ | client/pages/login/index.jsx | 26 | |
| 25 | if (!module.parent) { | client/pages/login/index.jsx | 30 | |
| 26 | window.app = App; | client/pages/login/index.jsx | 31 | |
| 27 | App.blastoff(); | client/pages/login/index.jsx | 32 | |
| 28 | } | client/pages/login/index.jsx | 32 | |
| 29 | /* $lab:coverage:on$ */ | client/pages/login/index.jsx | 33 | |
| 30 | client/pages/login/index.jsx | 33 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/login/components/App.jsx | 1 | |
| 2 | client/pages/login/components/App.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/login/components/App.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/login/components/App.jsx | 2 |
| 5 | client/pages/login/components/App.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | client/pages/login/components/App.jsx | 5 |
| 7 | displayName: 'Component', | client/pages/login/components/App.jsx | 5 | |
| 8 | client/pages/login/components/App.jsx | 5 | ||
| 9 | render: function render() { | client/pages/login/components/App.jsx | 6 | |
| 10 | client/pages/login/components/App.jsx | 6 | ||
| 11 | 2 | return React.createElement(ReactRouter.RouteHandler, null); | client/pages/login/components/App.jsx | 8 |
| 12 | } | client/pages/login/components/App.jsx | 10 | |
| 13 | }); | client/pages/login/components/App.jsx | 11 | |
| 14 | client/pages/login/components/App.jsx | 12 | ||
| 15 | 1 | module.exports = Component; | client/pages/login/components/App.jsx | 15 |
| 16 | client/pages/login/components/App.jsx | 15 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/login/components/Forgot.jsx | 1 | |
| 2 | client/pages/login/components/Forgot.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/login/components/Forgot.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/login/components/Forgot.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../components/form/ControlGroup'); | client/pages/login/components/Forgot.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../components/form/TextControl'); | client/pages/login/components/Forgot.jsx | 4 |
| 7 | 1 | var Button = require('../../../components/form/Button'); | client/pages/login/components/Forgot.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../components/form/Spinner'); | client/pages/login/components/Forgot.jsx | 6 |
| 9 | 1 | var Actions = require('../Actions'); | client/pages/login/components/Forgot.jsx | 7 |
| 10 | 1 | var ForgotStore = require('../stores/Forgot'); | client/pages/login/components/Forgot.jsx | 8 |
| 11 | client/pages/login/components/Forgot.jsx | 8 | ||
| 12 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/login/components/Forgot.jsx | 11 |
| 13 | 1 | var Link = ReactRouter.Link; | client/pages/login/components/Forgot.jsx | 12 |
| 14 | client/pages/login/components/Forgot.jsx | 12 | ||
| 15 | 1 | var Component = React.createClass({ | client/pages/login/components/Forgot.jsx | 15 |
| 16 | displayName: 'Component', | client/pages/login/components/Forgot.jsx | 15 | |
| 17 | client/pages/login/components/Forgot.jsx | 15 | ||
| 18 | mixins: [LinkedState], | client/pages/login/components/Forgot.jsx | 16 | |
| 19 | contextTypes: { | client/pages/login/components/Forgot.jsx | 17 | |
| 20 | router: React.PropTypes.func | client/pages/login/components/Forgot.jsx | 18 | |
| 21 | }, | client/pages/login/components/Forgot.jsx | 18 | |
| 22 | getInitialState: function getInitialState() { | client/pages/login/components/Forgot.jsx | 20 | |
| 23 | client/pages/login/components/Forgot.jsx | 20 | ||
| 24 | 7 | ForgotStore.reset(); | client/pages/login/components/Forgot.jsx | 22 |
| 25 | 7 | return ForgotStore.getState(); | client/pages/login/components/Forgot.jsx | 23 |
| 26 | }, | client/pages/login/components/Forgot.jsx | 23 | |
| 27 | componentDidMount: function componentDidMount() { | client/pages/login/components/Forgot.jsx | 25 | |
| 28 | client/pages/login/components/Forgot.jsx | 25 | ||
| 29 | 7 | ForgotStore.addChangeListener(this.onStoreChange); | client/pages/login/components/Forgot.jsx | 27 |
| 30 | 7 | this.refs.email.refs.inputField.getDOMNode().focus(); | client/pages/login/components/Forgot.jsx | 28 |
| 31 | }, | client/pages/login/components/Forgot.jsx | 28 | |
| 32 | componentWillUnmount: function componentWillUnmount() { | client/pages/login/components/Forgot.jsx | 30 | |
| 33 | client/pages/login/components/Forgot.jsx | 30 | ||
| 34 | 1 | ForgotStore.removeChangeListener(this.onStoreChange); | client/pages/login/components/Forgot.jsx | 32 |
| 35 | }, | client/pages/login/components/Forgot.jsx | 32 | |
| 36 | onStoreChange: function onStoreChange() { | client/pages/login/components/Forgot.jsx | 34 | |
| 37 | client/pages/login/components/Forgot.jsx | 34 | ||
| 38 | 17 | this.setState(ForgotStore.getState()); | client/pages/login/components/Forgot.jsx | 36 |
| 39 | }, | client/pages/login/components/Forgot.jsx | 36 | |
| 40 | handleSubmit: function handleSubmit(event) { | client/pages/login/components/Forgot.jsx | 38 | |
| 41 | client/pages/login/components/Forgot.jsx | 38 | ||
| 42 | 1 | event.preventDefault(); | client/pages/login/components/Forgot.jsx | 40 |
| 43 | 1 | event.stopPropagation(); | client/pages/login/components/Forgot.jsx | 41 |
| 44 | client/pages/login/components/Forgot.jsx | 41 | ||
| 45 | 1 | Actions.forgot({ | client/pages/login/components/Forgot.jsx | 43 |
| 46 | email: this.state.email | client/pages/login/components/Forgot.jsx | 44 | |
| 47 | }); | client/pages/login/components/Forgot.jsx | 44 | |
| 48 | }, | client/pages/login/components/Forgot.jsx | 45 | |
| 49 | render: function render() { | client/pages/login/components/Forgot.jsx | 47 | |
| 50 | client/pages/login/components/Forgot.jsx | 47 | ||
| 51 | 24 | var alerts = []; | client/pages/login/components/Forgot.jsx | 49 |
| 52 | 24 | if (this.state.success) { | client/pages/login/components/Forgot.jsx | 50 |
| 53 | 5 | alerts.push(React.createElement( | client/pages/login/components/Forgot.jsx | 51 |
| 54 | 'div', | client/pages/login/components/Forgot.jsx | 51 | |
| 55 | { key: 'success' }, | client/pages/login/components/Forgot.jsx | 51 | |
| 56 | React.createElement( | client/pages/login/components/Forgot.jsx | 51 | |
| 57 | 'div', | client/pages/login/components/Forgot.jsx | 52 | |
| 58 | { className: 'alert alert-success' }, | client/pages/login/components/Forgot.jsx | 52 | |
| 59 | 'If an account matched that address, an email will be sent with instructions.' | client/pages/login/components/Forgot.jsx | 52 | |
| 60 | ), | client/pages/login/components/Forgot.jsx | 52 | |
| 61 | React.createElement( | client/pages/login/components/Forgot.jsx | 54 | |
| 62 | Link, | client/pages/login/components/Forgot.jsx | 55 | |
| 63 | { to: 'home', className: 'btn btn-link' }, | client/pages/login/components/Forgot.jsx | 55 | |
| 64 | 'Back to login' | client/pages/login/components/Forgot.jsx | 55 | |
| 65 | ) | client/pages/login/components/Forgot.jsx | 55 | |
| 66 | )); | client/pages/login/components/Forgot.jsx | 55 | |
| 67 | 19 | } else if (this.state.error) { | client/pages/login/components/Forgot.jsx | 56 |
| 68 | 6 | alerts.push(React.createElement( | client/pages/login/components/Forgot.jsx | 59 |
| 69 | 'div', | client/pages/login/components/Forgot.jsx | 59 | |
| 70 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/login/components/Forgot.jsx | 59 | |
| 71 | this.state.error | client/pages/login/components/Forgot.jsx | 59 | |
| 72 | )); | client/pages/login/components/Forgot.jsx | 60 | |
| 73 | } | client/pages/login/components/Forgot.jsx | 61 | |
| 74 | client/pages/login/components/Forgot.jsx | 62 | ||
| 75 | 24 | var formElements; | client/pages/login/components/Forgot.jsx | 64 |
| 76 | 24 | if (!this.state.success) { | client/pages/login/components/Forgot.jsx | 65 |
| 77 | 19 | formElements = React.createElement( | client/pages/login/components/Forgot.jsx | 66 |
| 78 | 'fieldset', | client/pages/login/components/Forgot.jsx | 66 | |
| 79 | null, | client/pages/login/components/Forgot.jsx | 66 | |
| 80 | React.createElement(TextControl, { | client/pages/login/components/Forgot.jsx | 66 | |
| 81 | name: 'email', | client/pages/login/components/Forgot.jsx | 68 | |
| 82 | label: 'What\'s your email?', | client/pages/login/components/Forgot.jsx | 69 | |
| 83 | ref: 'email', | client/pages/login/components/Forgot.jsx | 70 | |
| 84 | hasError: this.state.hasError.email, | client/pages/login/components/Forgot.jsx | 71 | |
| 85 | valueLink: this.linkState('email'), | client/pages/login/components/Forgot.jsx | 72 | |
| 86 | help: this.state.help.email, | client/pages/login/components/Forgot.jsx | 73 | |
| 87 | disabled: this.state.loading | client/pages/login/components/Forgot.jsx | 74 | |
| 88 | }), | client/pages/login/components/Forgot.jsx | 74 | |
| 89 | React.createElement( | client/pages/login/components/Forgot.jsx | 75 | |
| 90 | ControlGroup, | client/pages/login/components/Forgot.jsx | 76 | |
| 91 | { hideLabel: true, hideHelp: true }, | client/pages/login/components/Forgot.jsx | 76 | |
| 92 | React.createElement( | client/pages/login/components/Forgot.jsx | 76 | |
| 93 | Button, | client/pages/login/components/Forgot.jsx | 77 | |
| 94 | { | client/pages/login/components/Forgot.jsx | 77 | |
| 95 | type: 'submit', | client/pages/login/components/Forgot.jsx | 78 | |
| 96 | inputClasses: { 'btn-primary': true }, | client/pages/login/components/Forgot.jsx | 79 | |
| 97 | disabled: this.state.loading }, | client/pages/login/components/Forgot.jsx | 80 | |
| 98 | 'Send reset', | client/pages/login/components/Forgot.jsx | 80 | |
| 99 | React.createElement(Spinner, { space: 'left', show: this.state.loading }) | client/pages/login/components/Forgot.jsx | 80 | |
| 100 | ), | client/pages/login/components/Forgot.jsx | 83 | |
| 101 | React.createElement( | client/pages/login/components/Forgot.jsx | 84 | |
| 102 | Link, | client/pages/login/components/Forgot.jsx | 85 | |
| 103 | { to: 'home', className: 'btn btn-link' }, | client/pages/login/components/Forgot.jsx | 85 | |
| 104 | 'Back to login' | client/pages/login/components/Forgot.jsx | 85 | |
| 105 | ) | client/pages/login/components/Forgot.jsx | 85 | |
| 106 | ) | client/pages/login/components/Forgot.jsx | 85 | |
| 107 | ); | client/pages/login/components/Forgot.jsx | 86 | |
| 108 | } | client/pages/login/components/Forgot.jsx | 87 | |
| 109 | client/pages/login/components/Forgot.jsx | 88 | ||
| 110 | 24 | return React.createElement( | client/pages/login/components/Forgot.jsx | 90 |
| 111 | 'section', | client/pages/login/components/Forgot.jsx | 91 | |
| 112 | null, | client/pages/login/components/Forgot.jsx | 91 | |
| 113 | React.createElement( | client/pages/login/components/Forgot.jsx | 91 | |
| 114 | 'h1', | client/pages/login/components/Forgot.jsx | 92 | |
| 115 | { className: 'page-header' }, | client/pages/login/components/Forgot.jsx | 92 | |
| 116 | 'Forgot your password?' | client/pages/login/components/Forgot.jsx | 92 | |
| 117 | ), | client/pages/login/components/Forgot.jsx | 92 | |
| 118 | React.createElement( | client/pages/login/components/Forgot.jsx | 92 | |
| 119 | 'form', | client/pages/login/components/Forgot.jsx | 93 | |
| 120 | { onSubmit: this.handleSubmit }, | client/pages/login/components/Forgot.jsx | 93 | |
| 121 | alerts, | client/pages/login/components/Forgot.jsx | 93 | |
| 122 | formElements | client/pages/login/components/Forgot.jsx | 94 | |
| 123 | ) | client/pages/login/components/Forgot.jsx | 95 | |
| 124 | ); | client/pages/login/components/Forgot.jsx | 96 | |
| 125 | } | client/pages/login/components/Forgot.jsx | 98 | |
| 126 | }); | client/pages/login/components/Forgot.jsx | 99 | |
| 127 | client/pages/login/components/Forgot.jsx | 100 | ||
| 128 | 1 | module.exports = Component; | client/pages/login/components/Forgot.jsx | 103 |
| 129 | client/pages/login/components/Forgot.jsx | 103 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/login/components/Home.jsx | 1 | |
| 2 | client/pages/login/components/Home.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/login/components/Home.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/login/components/Home.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../components/form/ControlGroup'); | client/pages/login/components/Home.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../components/form/TextControl'); | client/pages/login/components/Home.jsx | 4 |
| 7 | 1 | var Button = require('../../../components/form/Button'); | client/pages/login/components/Home.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../components/form/Spinner'); | client/pages/login/components/Home.jsx | 6 |
| 9 | 1 | var Actions = require('../Actions'); | client/pages/login/components/Home.jsx | 7 |
| 10 | 1 | var LoginStore = require('../stores/Login'); | client/pages/login/components/Home.jsx | 8 |
| 11 | client/pages/login/components/Home.jsx | 8 | ||
| 12 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/login/components/Home.jsx | 11 |
| 13 | 1 | var Link = ReactRouter.Link; | client/pages/login/components/Home.jsx | 12 |
| 14 | 1 | var Navigation = ReactRouter.Navigation; | client/pages/login/components/Home.jsx | 13 |
| 15 | client/pages/login/components/Home.jsx | 13 | ||
| 16 | 1 | var Component = React.createClass({ | client/pages/login/components/Home.jsx | 16 |
| 17 | displayName: 'Component', | client/pages/login/components/Home.jsx | 16 | |
| 18 | client/pages/login/components/Home.jsx | 16 | ||
| 19 | mixins: [LinkedState, Navigation], | client/pages/login/components/Home.jsx | 17 | |
| 20 | getInitialState: function getInitialState() { | client/pages/login/components/Home.jsx | 18 | |
| 21 | client/pages/login/components/Home.jsx | 18 | ||
| 22 | 8 | LoginStore.reset(); | client/pages/login/components/Home.jsx | 20 |
| 23 | 8 | return LoginStore.getState(); | client/pages/login/components/Home.jsx | 21 |
| 24 | }, | client/pages/login/components/Home.jsx | 21 | |
| 25 | componentDidMount: function componentDidMount() { | client/pages/login/components/Home.jsx | 23 | |
| 26 | client/pages/login/components/Home.jsx | 23 | ||
| 27 | 8 | LoginStore.addChangeListener(this.onStoreChange); | client/pages/login/components/Home.jsx | 25 |
| 28 | 8 | this.refs.username.refs.inputField.getDOMNode().focus(); | client/pages/login/components/Home.jsx | 26 |
| 29 | }, | client/pages/login/components/Home.jsx | 26 | |
| 30 | componentWillUnmount: function componentWillUnmount() { | client/pages/login/components/Home.jsx | 28 | |
| 31 | client/pages/login/components/Home.jsx | 28 | ||
| 32 | 2 | LoginStore.removeChangeListener(this.onStoreChange); | client/pages/login/components/Home.jsx | 30 |
| 33 | }, | client/pages/login/components/Home.jsx | 30 | |
| 34 | onStoreChange: function onStoreChange() { | client/pages/login/components/Home.jsx | 32 | |
| 35 | client/pages/login/components/Home.jsx | 32 | ||
| 36 | 17 | this.setState(LoginStore.getState()); | client/pages/login/components/Home.jsx | 34 |
| 37 | }, | client/pages/login/components/Home.jsx | 34 | |
| 38 | handleSubmit: function handleSubmit(event) { | client/pages/login/components/Home.jsx | 36 | |
| 39 | client/pages/login/components/Home.jsx | 36 | ||
| 40 | 1 | event.preventDefault(); | client/pages/login/components/Home.jsx | 38 |
| 41 | 1 | event.stopPropagation(); | client/pages/login/components/Home.jsx | 39 |
| 42 | client/pages/login/components/Home.jsx | 39 | ||
| 43 | 1 | Actions.login({ | client/pages/login/components/Home.jsx | 41 |
| 44 | username: this.state.username, | client/pages/login/components/Home.jsx | 42 | |
| 45 | password: this.state.password | client/pages/login/components/Home.jsx | 43 | |
| 46 | }); | client/pages/login/components/Home.jsx | 43 | |
| 47 | }, | client/pages/login/components/Home.jsx | 44 | |
| 48 | render: function render() { | client/pages/login/components/Home.jsx | 46 | |
| 49 | client/pages/login/components/Home.jsx | 46 | ||
| 50 | 25 | var alerts = []; | client/pages/login/components/Home.jsx | 48 |
| 51 | 25 | if (this.state.success) { | client/pages/login/components/Home.jsx | 49 |
| 52 | 5 | alerts.push(React.createElement( | client/pages/login/components/Home.jsx | 50 |
| 53 | 'div', | client/pages/login/components/Home.jsx | 50 | |
| 54 | { key: 'success', className: 'alert alert-success' }, | client/pages/login/components/Home.jsx | 50 | |
| 55 | 'Success. Redirecting...' | client/pages/login/components/Home.jsx | 50 | |
| 56 | )); | client/pages/login/components/Home.jsx | 50 | |
| 57 | 20 | } else if (this.state.error) { | client/pages/login/components/Home.jsx | 52 |
| 58 | 6 | alerts.push(React.createElement( | client/pages/login/components/Home.jsx | 55 |
| 59 | 'div', | client/pages/login/components/Home.jsx | 55 | |
| 60 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/login/components/Home.jsx | 55 | |
| 61 | this.state.error | client/pages/login/components/Home.jsx | 55 | |
| 62 | )); | client/pages/login/components/Home.jsx | 56 | |
| 63 | } | client/pages/login/components/Home.jsx | 57 | |
| 64 | client/pages/login/components/Home.jsx | 58 | ||
| 65 | 25 | var formElements; | client/pages/login/components/Home.jsx | 60 |
| 66 | 25 | if (!this.state.success) { | client/pages/login/components/Home.jsx | 61 |
| 67 | 20 | formElements = React.createElement( | client/pages/login/components/Home.jsx | 62 |
| 68 | 'fieldset', | client/pages/login/components/Home.jsx | 62 | |
| 69 | null, | client/pages/login/components/Home.jsx | 62 | |
| 70 | React.createElement(TextControl, { | client/pages/login/components/Home.jsx | 62 | |
| 71 | name: 'username', | client/pages/login/components/Home.jsx | 64 | |
| 72 | label: 'Username or email', | client/pages/login/components/Home.jsx | 65 | |
| 73 | ref: 'username', | client/pages/login/components/Home.jsx | 66 | |
| 74 | hasError: this.state.hasError.username, | client/pages/login/components/Home.jsx | 67 | |
| 75 | valueLink: this.linkState('username'), | client/pages/login/components/Home.jsx | 68 | |
| 76 | help: this.state.help.username, | client/pages/login/components/Home.jsx | 69 | |
| 77 | disabled: this.state.loading | client/pages/login/components/Home.jsx | 70 | |
| 78 | }), | client/pages/login/components/Home.jsx | 70 | |
| 79 | React.createElement(TextControl, { | client/pages/login/components/Home.jsx | 71 | |
| 80 | name: 'password', | client/pages/login/components/Home.jsx | 73 | |
| 81 | label: 'Password', | client/pages/login/components/Home.jsx | 74 | |
| 82 | type: 'password', | client/pages/login/components/Home.jsx | 75 | |
| 83 | hasError: this.state.hasError.password, | client/pages/login/components/Home.jsx | 76 | |
| 84 | valueLink: this.linkState('password'), | client/pages/login/components/Home.jsx | 77 | |
| 85 | help: this.state.help.password, | client/pages/login/components/Home.jsx | 78 | |
| 86 | disabled: this.state.loading | client/pages/login/components/Home.jsx | 79 | |
| 87 | }), | client/pages/login/components/Home.jsx | 79 | |
| 88 | React.createElement( | client/pages/login/components/Home.jsx | 80 | |
| 89 | ControlGroup, | client/pages/login/components/Home.jsx | 81 | |
| 90 | { hideLabel: true, hideHelp: true }, | client/pages/login/components/Home.jsx | 81 | |
| 91 | React.createElement( | client/pages/login/components/Home.jsx | 81 | |
| 92 | Button, | client/pages/login/components/Home.jsx | 82 | |
| 93 | { | client/pages/login/components/Home.jsx | 82 | |
| 94 | type: 'submit', | client/pages/login/components/Home.jsx | 83 | |
| 95 | inputClasses: { 'btn-primary': true }, | client/pages/login/components/Home.jsx | 84 | |
| 96 | disabled: this.state.loading }, | client/pages/login/components/Home.jsx | 85 | |
| 97 | 'Sign in', | client/pages/login/components/Home.jsx | 85 | |
| 98 | React.createElement(Spinner, { space: 'left', show: this.state.loading }) | client/pages/login/components/Home.jsx | 85 | |
| 99 | ), | client/pages/login/components/Home.jsx | 88 | |
| 100 | React.createElement( | client/pages/login/components/Home.jsx | 89 | |
| 101 | Link, | client/pages/login/components/Home.jsx | 90 | |
| 102 | { to: 'forgot', className: 'btn btn-link' }, | client/pages/login/components/Home.jsx | 90 | |
| 103 | 'Forgot your password?' | client/pages/login/components/Home.jsx | 90 | |
| 104 | ) | client/pages/login/components/Home.jsx | 90 | |
| 105 | ) | client/pages/login/components/Home.jsx | 90 | |
| 106 | ); | client/pages/login/components/Home.jsx | 91 | |
| 107 | } | client/pages/login/components/Home.jsx | 92 | |
| 108 | client/pages/login/components/Home.jsx | 93 | ||
| 109 | 25 | return React.createElement( | client/pages/login/components/Home.jsx | 95 |
| 110 | 'section', | client/pages/login/components/Home.jsx | 96 | |
| 111 | null, | client/pages/login/components/Home.jsx | 96 | |
| 112 | React.createElement( | client/pages/login/components/Home.jsx | 96 | |
| 113 | 'h1', | client/pages/login/components/Home.jsx | 97 | |
| 114 | { className: 'page-header' }, | client/pages/login/components/Home.jsx | 97 | |
| 115 | 'Sign in' | client/pages/login/components/Home.jsx | 97 | |
| 116 | ), | client/pages/login/components/Home.jsx | 97 | |
| 117 | React.createElement( | client/pages/login/components/Home.jsx | 97 | |
| 118 | 'form', | client/pages/login/components/Home.jsx | 98 | |
| 119 | { onSubmit: this.handleSubmit }, | client/pages/login/components/Home.jsx | 98 | |
| 120 | alerts, | client/pages/login/components/Home.jsx | 98 | |
| 121 | formElements | client/pages/login/components/Home.jsx | 99 | |
| 122 | ) | client/pages/login/components/Home.jsx | 100 | |
| 123 | ); | client/pages/login/components/Home.jsx | 101 | |
| 124 | } | client/pages/login/components/Home.jsx | 103 | |
| 125 | }); | client/pages/login/components/Home.jsx | 104 | |
| 126 | client/pages/login/components/Home.jsx | 105 | ||
| 127 | 1 | module.exports = Component; | client/pages/login/components/Home.jsx | 108 |
| 128 | client/pages/login/components/Home.jsx | 108 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/login/components/Logout.jsx | 1 | |
| 2 | client/pages/login/components/Logout.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/login/components/Logout.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/login/components/Logout.jsx | 2 |
| 5 | 1 | var Actions = require('../Actions'); | client/pages/login/components/Logout.jsx | 3 |
| 6 | 1 | var LogoutStore = require('../stores/Logout'); | client/pages/login/components/Logout.jsx | 4 |
| 7 | client/pages/login/components/Logout.jsx | 4 | ||
| 8 | 1 | var Link = ReactRouter.Link; | client/pages/login/components/Logout.jsx | 7 |
| 9 | 1 | var Navigation = ReactRouter.Navigation; | client/pages/login/components/Logout.jsx | 8 |
| 10 | client/pages/login/components/Logout.jsx | 8 | ||
| 11 | 1 | var Component = React.createClass({ | client/pages/login/components/Logout.jsx | 11 |
| 12 | displayName: 'Component', | client/pages/login/components/Logout.jsx | 11 | |
| 13 | client/pages/login/components/Logout.jsx | 11 | ||
| 14 | mixins: [Navigation], | client/pages/login/components/Logout.jsx | 12 | |
| 15 | getInitialState: function getInitialState() { | client/pages/login/components/Logout.jsx | 13 | |
| 16 | client/pages/login/components/Logout.jsx | 13 | ||
| 17 | 5 | LogoutStore.reset(); | client/pages/login/components/Logout.jsx | 15 |
| 18 | 5 | return LogoutStore.getState(); | client/pages/login/components/Logout.jsx | 16 |
| 19 | }, | client/pages/login/components/Logout.jsx | 16 | |
| 20 | componentDidMount: function componentDidMount() { | client/pages/login/components/Logout.jsx | 18 | |
| 21 | client/pages/login/components/Logout.jsx | 18 | ||
| 22 | 5 | LogoutStore.addChangeListener(this.onStoreChange); | client/pages/login/components/Logout.jsx | 20 |
| 23 | 5 | Actions.logout(); | client/pages/login/components/Logout.jsx | 21 |
| 24 | }, | client/pages/login/components/Logout.jsx | 21 | |
| 25 | componentWillUnmount: function componentWillUnmount() { | client/pages/login/components/Logout.jsx | 23 | |
| 26 | client/pages/login/components/Logout.jsx | 23 | ||
| 27 | 1 | LogoutStore.removeChangeListener(this.onStoreChange); | client/pages/login/components/Logout.jsx | 25 |
| 28 | }, | client/pages/login/components/Logout.jsx | 25 | |
| 29 | onStoreChange: function onStoreChange() { | client/pages/login/components/Logout.jsx | 27 | |
| 30 | client/pages/login/components/Logout.jsx | 27 | ||
| 31 | 9 | this.setState(LogoutStore.getState()); | client/pages/login/components/Logout.jsx | 29 |
| 32 | }, | client/pages/login/components/Logout.jsx | 29 | |
| 33 | render: function render() { | client/pages/login/components/Logout.jsx | 31 | |
| 34 | client/pages/login/components/Logout.jsx | 31 | ||
| 35 | 14 | var alerts = []; | client/pages/login/components/Logout.jsx | 33 |
| 36 | 14 | if (this.state.success) { | client/pages/login/components/Logout.jsx | 34 |
| 37 | 3 | alerts.push(React.createElement( | client/pages/login/components/Logout.jsx | 35 |
| 38 | 'div', | client/pages/login/components/Logout.jsx | 35 | |
| 39 | { key: 'success', className: 'alert alert-success' }, | client/pages/login/components/Logout.jsx | 35 | |
| 40 | 'Logout successful.' | client/pages/login/components/Logout.jsx | 35 | |
| 41 | )); | client/pages/login/components/Logout.jsx | 35 | |
| 42 | 11 | } else if (this.state.error) { | client/pages/login/components/Logout.jsx | 37 |
| 43 | 4 | alerts.push(React.createElement( | client/pages/login/components/Logout.jsx | 40 |
| 44 | 'div', | client/pages/login/components/Logout.jsx | 40 | |
| 45 | { key: 'danger', className: 'alert alert-warning' }, | client/pages/login/components/Logout.jsx | 40 | |
| 46 | this.state.error | client/pages/login/components/Logout.jsx | 40 | |
| 47 | )); | client/pages/login/components/Logout.jsx | 41 | |
| 48 | } | client/pages/login/components/Logout.jsx | 42 | |
| 49 | client/pages/login/components/Logout.jsx | 43 | ||
| 50 | 14 | return React.createElement( | client/pages/login/components/Logout.jsx | 45 |
| 51 | 'section', | client/pages/login/components/Logout.jsx | 46 | |
| 52 | null, | client/pages/login/components/Logout.jsx | 46 | |
| 53 | React.createElement( | client/pages/login/components/Logout.jsx | 46 | |
| 54 | 'h1', | client/pages/login/components/Logout.jsx | 47 | |
| 55 | { className: 'page-header' }, | client/pages/login/components/Logout.jsx | 47 | |
| 56 | 'Sign out' | client/pages/login/components/Logout.jsx | 47 | |
| 57 | ), | client/pages/login/components/Logout.jsx | 47 | |
| 58 | alerts, | client/pages/login/components/Logout.jsx | 47 | |
| 59 | React.createElement( | client/pages/login/components/Logout.jsx | 48 | |
| 60 | Link, | client/pages/login/components/Logout.jsx | 49 | |
| 61 | { to: 'home', className: 'btn btn-link' }, | client/pages/login/components/Logout.jsx | 49 | |
| 62 | 'Back to login' | client/pages/login/components/Logout.jsx | 49 | |
| 63 | ) | client/pages/login/components/Logout.jsx | 49 | |
| 64 | ); | client/pages/login/components/Logout.jsx | 49 | |
| 65 | } | client/pages/login/components/Logout.jsx | 51 | |
| 66 | }); | client/pages/login/components/Logout.jsx | 52 | |
| 67 | client/pages/login/components/Logout.jsx | 53 | ||
| 68 | 1 | module.exports = Component; | client/pages/login/components/Logout.jsx | 56 |
| 69 | client/pages/login/components/Logout.jsx | 56 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/login/components/NotFound.jsx | 1 | |
| 2 | client/pages/login/components/NotFound.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/login/components/NotFound.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/login/components/NotFound.jsx | 2 |
| 5 | client/pages/login/components/NotFound.jsx | 2 | ||
| 6 | 1 | var Link = ReactRouter.Link; | client/pages/login/components/NotFound.jsx | 5 |
| 7 | client/pages/login/components/NotFound.jsx | 5 | ||
| 8 | 1 | var Component = React.createClass({ | client/pages/login/components/NotFound.jsx | 8 |
| 9 | displayName: 'Component', | client/pages/login/components/NotFound.jsx | 8 | |
| 10 | client/pages/login/components/NotFound.jsx | 8 | ||
| 11 | render: function render() { | client/pages/login/components/NotFound.jsx | 9 | |
| 12 | client/pages/login/components/NotFound.jsx | 9 | ||
| 13 | 2 | return React.createElement( | client/pages/login/components/NotFound.jsx | 11 |
| 14 | 'section', | client/pages/login/components/NotFound.jsx | 12 | |
| 15 | { className: 'section-not-found container' }, | client/pages/login/components/NotFound.jsx | 12 | |
| 16 | React.createElement( | client/pages/login/components/NotFound.jsx | 12 | |
| 17 | 'h1', | client/pages/login/components/NotFound.jsx | 13 | |
| 18 | { className: 'page-header' }, | client/pages/login/components/NotFound.jsx | 13 | |
| 19 | 'Not Found' | client/pages/login/components/NotFound.jsx | 13 | |
| 20 | ), | client/pages/login/components/NotFound.jsx | 13 | |
| 21 | React.createElement( | client/pages/login/components/NotFound.jsx | 13 | |
| 22 | 'p', | client/pages/login/components/NotFound.jsx | 14 | |
| 23 | null, | client/pages/login/components/NotFound.jsx | 14 | |
| 24 | 'That route didn\'t match any handlers.' | client/pages/login/components/NotFound.jsx | 14 | |
| 25 | ), | client/pages/login/components/NotFound.jsx | 14 | |
| 26 | React.createElement( | client/pages/login/components/NotFound.jsx | 14 | |
| 27 | Link, | client/pages/login/components/NotFound.jsx | 15 | |
| 28 | { to: 'home' }, | client/pages/login/components/NotFound.jsx | 15 | |
| 29 | 'Back to login' | client/pages/login/components/NotFound.jsx | 15 | |
| 30 | ) | client/pages/login/components/NotFound.jsx | 15 | |
| 31 | ); | client/pages/login/components/NotFound.jsx | 15 | |
| 32 | } | client/pages/login/components/NotFound.jsx | 17 | |
| 33 | }); | client/pages/login/components/NotFound.jsx | 18 | |
| 34 | client/pages/login/components/NotFound.jsx | 19 | ||
| 35 | 1 | module.exports = Component; | client/pages/login/components/NotFound.jsx | 22 |
| 36 | client/pages/login/components/NotFound.jsx | 22 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/login/components/Reset.jsx | 1 | |
| 2 | client/pages/login/components/Reset.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/login/components/Reset.jsx | 1 |
| 4 | 1 | var ReactRouter = require('react-router'); | client/pages/login/components/Reset.jsx | 2 |
| 5 | 1 | var ControlGroup = require('../../../components/form/ControlGroup'); | client/pages/login/components/Reset.jsx | 3 |
| 6 | 1 | var TextControl = require('../../../components/form/TextControl'); | client/pages/login/components/Reset.jsx | 4 |
| 7 | 1 | var Button = require('../../../components/form/Button'); | client/pages/login/components/Reset.jsx | 5 |
| 8 | 1 | var Spinner = require('../../../components/form/Spinner'); | client/pages/login/components/Reset.jsx | 6 |
| 9 | 1 | var Actions = require('../Actions'); | client/pages/login/components/Reset.jsx | 7 |
| 10 | 1 | var ResetStore = require('../stores/Reset'); | client/pages/login/components/Reset.jsx | 8 |
| 11 | client/pages/login/components/Reset.jsx | 8 | ||
| 12 | 1 | var LinkedState = React.addons.LinkedStateMixin; | client/pages/login/components/Reset.jsx | 11 |
| 13 | 1 | var Link = ReactRouter.Link; | client/pages/login/components/Reset.jsx | 12 |
| 14 | client/pages/login/components/Reset.jsx | 12 | ||
| 15 | 1 | var Component = React.createClass({ | client/pages/login/components/Reset.jsx | 15 |
| 16 | displayName: 'Component', | client/pages/login/components/Reset.jsx | 15 | |
| 17 | client/pages/login/components/Reset.jsx | 15 | ||
| 18 | mixins: [LinkedState], | client/pages/login/components/Reset.jsx | 16 | |
| 19 | contextTypes: { | client/pages/login/components/Reset.jsx | 17 | |
| 20 | router: React.PropTypes.func | client/pages/login/components/Reset.jsx | 18 | |
| 21 | }, | client/pages/login/components/Reset.jsx | 18 | |
| 22 | getInitialState: function getInitialState() { | client/pages/login/components/Reset.jsx | 20 | |
| 23 | client/pages/login/components/Reset.jsx | 20 | ||
| 24 | 7 | ResetStore.reset(); | client/pages/login/components/Reset.jsx | 22 |
| 25 | 7 | return ResetStore.getState(); | client/pages/login/components/Reset.jsx | 23 |
| 26 | }, | client/pages/login/components/Reset.jsx | 23 | |
| 27 | componentDidMount: function componentDidMount() { | client/pages/login/components/Reset.jsx | 25 | |
| 28 | client/pages/login/components/Reset.jsx | 25 | ||
| 29 | 7 | ResetStore.addChangeListener(this.onStoreChange); | client/pages/login/components/Reset.jsx | 27 |
| 30 | 7 | this.refs.password.refs.inputField.getDOMNode().focus(); | client/pages/login/components/Reset.jsx | 28 |
| 31 | }, | client/pages/login/components/Reset.jsx | 28 | |
| 32 | componentWillUnmount: function componentWillUnmount() { | client/pages/login/components/Reset.jsx | 30 | |
| 33 | client/pages/login/components/Reset.jsx | 30 | ||
| 34 | 1 | ResetStore.removeChangeListener(this.onStoreChange); | client/pages/login/components/Reset.jsx | 32 |
| 35 | }, | client/pages/login/components/Reset.jsx | 32 | |
| 36 | onStoreChange: function onStoreChange() { | client/pages/login/components/Reset.jsx | 34 | |
| 37 | client/pages/login/components/Reset.jsx | 34 | ||
| 38 | 17 | this.setState(ResetStore.getState()); | client/pages/login/components/Reset.jsx | 36 |
| 39 | }, | client/pages/login/components/Reset.jsx | 36 | |
| 40 | handleSubmit: function handleSubmit(event) { | client/pages/login/components/Reset.jsx | 38 | |
| 41 | client/pages/login/components/Reset.jsx | 38 | ||
| 42 | 1 | event.preventDefault(); | client/pages/login/components/Reset.jsx | 40 |
| 43 | 1 | event.stopPropagation(); | client/pages/login/components/Reset.jsx | 41 |
| 44 | client/pages/login/components/Reset.jsx | 41 | ||
| 45 | 1 | Actions.reset({ | client/pages/login/components/Reset.jsx | 43 |
| 46 | email: this.context.router.getCurrentParams().email, | client/pages/login/components/Reset.jsx | 44 | |
| 47 | key: this.context.router.getCurrentParams().key, | client/pages/login/components/Reset.jsx | 45 | |
| 48 | password: this.state.password | client/pages/login/components/Reset.jsx | 46 | |
| 49 | }); | client/pages/login/components/Reset.jsx | 46 | |
| 50 | }, | client/pages/login/components/Reset.jsx | 47 | |
| 51 | render: function render() { | client/pages/login/components/Reset.jsx | 49 | |
| 52 | client/pages/login/components/Reset.jsx | 49 | ||
| 53 | 24 | var alerts = []; | client/pages/login/components/Reset.jsx | 51 |
| 54 | 24 | if (this.state.success) { | client/pages/login/components/Reset.jsx | 52 |
| 55 | 5 | alerts.push(React.createElement( | client/pages/login/components/Reset.jsx | 53 |
| 56 | 'div', | client/pages/login/components/Reset.jsx | 53 | |
| 57 | { key: 'success' }, | client/pages/login/components/Reset.jsx | 53 | |
| 58 | React.createElement( | client/pages/login/components/Reset.jsx | 53 | |
| 59 | 'div', | client/pages/login/components/Reset.jsx | 54 | |
| 60 | { className: 'alert alert-success' }, | client/pages/login/components/Reset.jsx | 54 | |
| 61 | 'Your password has been reset. Please login to confirm.' | client/pages/login/components/Reset.jsx | 54 | |
| 62 | ), | client/pages/login/components/Reset.jsx | 54 | |
| 63 | React.createElement( | client/pages/login/components/Reset.jsx | 56 | |
| 64 | Link, | client/pages/login/components/Reset.jsx | 57 | |
| 65 | { to: 'home', className: 'btn btn-link' }, | client/pages/login/components/Reset.jsx | 57 | |
| 66 | 'Back to login' | client/pages/login/components/Reset.jsx | 57 | |
| 67 | ) | client/pages/login/components/Reset.jsx | 57 | |
| 68 | )); | client/pages/login/components/Reset.jsx | 57 | |
| 69 | 19 | } else if (this.state.error) { | client/pages/login/components/Reset.jsx | 58 |
| 70 | 6 | alerts.push(React.createElement( | client/pages/login/components/Reset.jsx | 61 |
| 71 | 'div', | client/pages/login/components/Reset.jsx | 61 | |
| 72 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/login/components/Reset.jsx | 61 | |
| 73 | this.state.error | client/pages/login/components/Reset.jsx | 61 | |
| 74 | )); | client/pages/login/components/Reset.jsx | 62 | |
| 75 | } | client/pages/login/components/Reset.jsx | 63 | |
| 76 | client/pages/login/components/Reset.jsx | 64 | ||
| 77 | 24 | var formElements; | client/pages/login/components/Reset.jsx | 66 |
| 78 | 24 | if (!this.state.success) { | client/pages/login/components/Reset.jsx | 67 |
| 79 | 19 | formElements = React.createElement( | client/pages/login/components/Reset.jsx | 68 |
| 80 | 'fieldset', | client/pages/login/components/Reset.jsx | 68 | |
| 81 | null, | client/pages/login/components/Reset.jsx | 68 | |
| 82 | React.createElement(TextControl, { | client/pages/login/components/Reset.jsx | 68 | |
| 83 | name: 'password', | client/pages/login/components/Reset.jsx | 70 | |
| 84 | label: 'New password', | client/pages/login/components/Reset.jsx | 71 | |
| 85 | type: 'password', | client/pages/login/components/Reset.jsx | 72 | |
| 86 | ref: 'password', | client/pages/login/components/Reset.jsx | 73 | |
| 87 | hasError: this.state.hasError.password, | client/pages/login/components/Reset.jsx | 74 | |
| 88 | valueLink: this.linkState('password'), | client/pages/login/components/Reset.jsx | 75 | |
| 89 | help: this.state.help.password, | client/pages/login/components/Reset.jsx | 76 | |
| 90 | disabled: this.state.loading | client/pages/login/components/Reset.jsx | 77 | |
| 91 | }), | client/pages/login/components/Reset.jsx | 77 | |
| 92 | React.createElement(TextControl, { | client/pages/login/components/Reset.jsx | 78 | |
| 93 | name: '_key', | client/pages/login/components/Reset.jsx | 80 | |
| 94 | label: 'Key', | client/pages/login/components/Reset.jsx | 81 | |
| 95 | hasError: this.state.hasError.key, | client/pages/login/components/Reset.jsx | 82 | |
| 96 | value: this.context.router.getCurrentParams().key, | client/pages/login/components/Reset.jsx | 83 | |
| 97 | help: this.state.help.key, | client/pages/login/components/Reset.jsx | 84 | |
| 98 | disabled: true | client/pages/login/components/Reset.jsx | 85 | |
| 99 | }), | client/pages/login/components/Reset.jsx | 85 | |
| 100 | React.createElement(TextControl, { | client/pages/login/components/Reset.jsx | 86 | |
| 101 | name: '_email', | client/pages/login/components/Reset.jsx | 88 | |
| 102 | label: 'Email', | client/pages/login/components/Reset.jsx | 89 | |
| 103 | hasError: this.state.hasError.email, | client/pages/login/components/Reset.jsx | 90 | |
| 104 | value: this.context.router.getCurrentParams().email, | client/pages/login/components/Reset.jsx | 91 | |
| 105 | help: this.state.help.email, | client/pages/login/components/Reset.jsx | 92 | |
| 106 | disabled: true | client/pages/login/components/Reset.jsx | 93 | |
| 107 | }), | client/pages/login/components/Reset.jsx | 93 | |
| 108 | React.createElement( | client/pages/login/components/Reset.jsx | 94 | |
| 109 | ControlGroup, | client/pages/login/components/Reset.jsx | 95 | |
| 110 | { hideLabel: true, hideHelp: true }, | client/pages/login/components/Reset.jsx | 95 | |
| 111 | React.createElement( | client/pages/login/components/Reset.jsx | 95 | |
| 112 | Button, | client/pages/login/components/Reset.jsx | 96 | |
| 113 | { | client/pages/login/components/Reset.jsx | 96 | |
| 114 | type: 'submit', | client/pages/login/components/Reset.jsx | 97 | |
| 115 | inputClasses: { 'btn-primary': true }, | client/pages/login/components/Reset.jsx | 98 | |
| 116 | disabled: this.state.loading }, | client/pages/login/components/Reset.jsx | 99 | |
| 117 | 'Set password', | client/pages/login/components/Reset.jsx | 99 | |
| 118 | React.createElement(Spinner, { space: 'left', show: this.state.loading }) | client/pages/login/components/Reset.jsx | 99 | |
| 119 | ), | client/pages/login/components/Reset.jsx | 102 | |
| 120 | React.createElement( | client/pages/login/components/Reset.jsx | 103 | |
| 121 | Link, | client/pages/login/components/Reset.jsx | 104 | |
| 122 | { to: 'home', className: 'btn btn-link' }, | client/pages/login/components/Reset.jsx | 104 | |
| 123 | 'Back to login' | client/pages/login/components/Reset.jsx | 104 | |
| 124 | ) | client/pages/login/components/Reset.jsx | 104 | |
| 125 | ) | client/pages/login/components/Reset.jsx | 104 | |
| 126 | ); | client/pages/login/components/Reset.jsx | 105 | |
| 127 | } | client/pages/login/components/Reset.jsx | 106 | |
| 128 | client/pages/login/components/Reset.jsx | 107 | ||
| 129 | 24 | return React.createElement( | client/pages/login/components/Reset.jsx | 109 |
| 130 | 'section', | client/pages/login/components/Reset.jsx | 110 | |
| 131 | null, | client/pages/login/components/Reset.jsx | 110 | |
| 132 | React.createElement( | client/pages/login/components/Reset.jsx | 110 | |
| 133 | 'h1', | client/pages/login/components/Reset.jsx | 111 | |
| 134 | { className: 'page-header' }, | client/pages/login/components/Reset.jsx | 111 | |
| 135 | 'Reset your password' | client/pages/login/components/Reset.jsx | 111 | |
| 136 | ), | client/pages/login/components/Reset.jsx | 111 | |
| 137 | React.createElement( | client/pages/login/components/Reset.jsx | 111 | |
| 138 | 'form', | client/pages/login/components/Reset.jsx | 112 | |
| 139 | { onSubmit: this.handleSubmit }, | client/pages/login/components/Reset.jsx | 112 | |
| 140 | alerts, | client/pages/login/components/Reset.jsx | 112 | |
| 141 | formElements | client/pages/login/components/Reset.jsx | 113 | |
| 142 | ) | client/pages/login/components/Reset.jsx | 114 | |
| 143 | ); | client/pages/login/components/Reset.jsx | 115 | |
| 144 | } | client/pages/login/components/Reset.jsx | 117 | |
| 145 | }); | client/pages/login/components/Reset.jsx | 118 | |
| 146 | client/pages/login/components/Reset.jsx | 119 | ||
| 147 | 1 | module.exports = Component; | client/pages/login/components/Reset.jsx | 122 |
| 148 | client/pages/login/components/Reset.jsx | 122 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../Constants'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | loading: false, | |
| 16 | success: false, | |
| 17 | error: undefined, | |
| 18 | hasError: {}, | |
| 19 | help: {} | |
| 20 | }, | |
| 21 | getState: function () { | |
| 22 | ||
| 23 | 29 | return this.state; |
| 24 | }, | |
| 25 | reset: function () { | |
| 26 | ||
| 27 | 8 | this.state = CloneDeep(this.defaultState); |
| 28 | }, | |
| 29 | onDispatcherAction: function (payload) { | |
| 30 | ||
| 31 | 157 | var action = payload.action; |
| 32 | ||
| 33 | 157 | if (ActionTypes.FORGOT === action.type) { |
| 34 | 2 | this.state.loading = true; |
| 35 | 2 | this.state.success = false; |
| 36 | 2 | this.state.error = undefined; |
| 37 | 2 | this.state.hasError = {}; |
| 38 | 2 | this.state.help = {}; |
| 39 | 2 | this.emitChange(); |
| 40 | } | |
| 41 | ||
| 42 | 157 | if (ActionTypes.FORGOT_RESPONSE === action.type) { |
| 43 | 5 | var validation = ParseValidation(action.data.validation, action.data.message); |
| 44 | ||
| 45 | 5 | this.state.loading = false; |
| 46 | 5 | this.state.success = action.data.success; |
| 47 | 5 | this.state.hasError = validation.hasError; |
| 48 | 5 | this.state.help = validation.help; |
| 49 | 5 | this.state.error = validation.error; |
| 50 | ||
| 51 | 5 | this.emitChange(); |
| 52 | } | |
| 53 | } | |
| 54 | }); | |
| 55 | ||
| 56 | ||
| 57 | 1 | module.exports = Store; |
| 58 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../Constants'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | loading: false, | |
| 16 | success: false, | |
| 17 | error: undefined, | |
| 18 | hasError: {}, | |
| 19 | help: {} | |
| 20 | }, | |
| 21 | getState: function () { | |
| 22 | ||
| 23 | 30 | return this.state; |
| 24 | }, | |
| 25 | reset: function () { | |
| 26 | ||
| 27 | 9 | this.state = CloneDeep(this.defaultState); |
| 28 | }, | |
| 29 | onDispatcherAction: function (payload) { | |
| 30 | ||
| 31 | 157 | var action = payload.action; |
| 32 | ||
| 33 | 157 | if (ActionTypes.LOGIN === action.type) { |
| 34 | 2 | this.state.loading = true; |
| 35 | 2 | this.state.success = false; |
| 36 | 2 | this.state.error = undefined; |
| 37 | 2 | this.state.hasError = {}; |
| 38 | 2 | this.state.help = {}; |
| 39 | 2 | this.emitChange(); |
| 40 | } | |
| 41 | ||
| 42 | 157 | if (ActionTypes.LOGIN_RESPONSE === action.type) { |
| 43 | 5 | var validation = ParseValidation(action.data.validation, action.data.message); |
| 44 | ||
| 45 | 5 | this.state.loading = false; |
| 46 | 5 | this.state.success = action.data.success; |
| 47 | 5 | this.state.hasError = validation.hasError; |
| 48 | 5 | this.state.help = validation.help; |
| 49 | 5 | this.state.error = validation.error; |
| 50 | ||
| 51 | 5 | this.emitChange(); |
| 52 | } | |
| 53 | } | |
| 54 | }); | |
| 55 | ||
| 56 | ||
| 57 | 1 | module.exports = Store; |
| 58 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../Constants'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | loading: false, | |
| 16 | success: false, | |
| 17 | error: undefined, | |
| 18 | hasError: {}, | |
| 19 | help: {} | |
| 20 | }, | |
| 21 | getState: function () { | |
| 22 | ||
| 23 | 19 | return this.state; |
| 24 | }, | |
| 25 | reset: function () { | |
| 26 | ||
| 27 | 6 | this.state = CloneDeep(this.defaultState); |
| 28 | }, | |
| 29 | onDispatcherAction: function (payload) { | |
| 30 | ||
| 31 | 156 | var action = payload.action; |
| 32 | ||
| 33 | 156 | if (ActionTypes.LOGOUT === action.type) { |
| 34 | 1 | this.state.loading = true; |
| 35 | 1 | this.state.success = false; |
| 36 | 1 | this.state.error = undefined; |
| 37 | 1 | this.state.hasError = {}; |
| 38 | 1 | this.state.help = {}; |
| 39 | 1 | this.emitChange(); |
| 40 | } | |
| 41 | ||
| 42 | 156 | if (ActionTypes.LOGOUT_RESPONSE === action.type) { |
| 43 | 5 | var validation = ParseValidation(action.data.validation, action.data.message); |
| 44 | ||
| 45 | 5 | this.state.loading = false; |
| 46 | 5 | this.state.success = action.data.success; |
| 47 | 5 | this.state.hasError = validation.hasError; |
| 48 | 5 | this.state.help = validation.help; |
| 49 | 5 | this.state.error = validation.error; |
| 50 | ||
| 51 | 5 | this.emitChange(); |
| 52 | } | |
| 53 | } | |
| 54 | }); | |
| 55 | ||
| 56 | ||
| 57 | 1 | module.exports = Store; |
| 58 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('../Constants'); |
| 5 | 1 | var ParseValidation = require('../../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | loading: false, | |
| 16 | success: false, | |
| 17 | error: undefined, | |
| 18 | hasError: {}, | |
| 19 | help: {} | |
| 20 | }, | |
| 21 | getState: function () { | |
| 22 | ||
| 23 | 29 | return this.state; |
| 24 | }, | |
| 25 | reset: function () { | |
| 26 | ||
| 27 | 8 | this.state = CloneDeep(this.defaultState); |
| 28 | }, | |
| 29 | onDispatcherAction: function (payload) { | |
| 30 | ||
| 31 | 157 | var action = payload.action; |
| 32 | ||
| 33 | 157 | if (ActionTypes.RESET === action.type) { |
| 34 | 2 | this.state.loading = true; |
| 35 | 2 | this.state.success = false; |
| 36 | 2 | this.state.error = undefined; |
| 37 | 2 | this.state.hasError = {}; |
| 38 | 2 | this.state.help = {}; |
| 39 | 2 | this.emitChange(); |
| 40 | } | |
| 41 | ||
| 42 | 157 | if (ActionTypes.RESET_RESPONSE === action.type) { |
| 43 | 5 | var validation = ParseValidation(action.data.validation, action.data.message); |
| 44 | ||
| 45 | 5 | this.state.loading = false; |
| 46 | 5 | this.state.success = action.data.success; |
| 47 | 5 | this.state.hasError = validation.hasError; |
| 48 | 5 | this.state.help = validation.help; |
| 49 | 5 | this.state.error = validation.error; |
| 50 | ||
| 51 | 5 | this.emitChange(); |
| 52 | } | |
| 53 | } | |
| 54 | }); | |
| 55 | ||
| 56 | ||
| 57 | 1 | module.exports = Store; |
| 58 |
| Line | Hits | Source |
|---|---|---|
| 1 | /* global window */ | |
| 2 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 3 | 1 | var Constants = require('./Constants'); |
| 4 | 1 | var Fetch = require('../../helpers/jsonFetch'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var VIEW_ACTION = Constants.PayloadSources.VIEW_ACTION; |
| 8 | 1 | var SERVER_ACTION = Constants.PayloadSources.SERVER_ACTION; |
| 9 | 1 | var Types = Constants.ActionTypes; |
| 10 | 1 | var dispatch = Dispatcher.handleAction; |
| 11 | ||
| 12 | ||
| 13 | 1 | var Actions = { |
| 14 | sendRequest: function (data) { | |
| 15 | ||
| 16 | 2 | dispatch(VIEW_ACTION, Types.SEND_REQUEST, data); |
| 17 | ||
| 18 | 2 | var request = { |
| 19 | method: 'POST', | |
| 20 | url: '/api/signup', | |
| 21 | data: data | |
| 22 | }; | |
| 23 | ||
| 24 | 2 | Fetch(request, function (err, response) { |
| 25 | ||
| 26 | 2 | if (!err) { |
| 27 | 1 | window.location.href = '/account'; |
| 28 | 1 | response.success = true; |
| 29 | } | |
| 30 | ||
| 31 | 2 | dispatch(SERVER_ACTION, Types.RECEIVE_RESPONSE, response); |
| 32 | }); | |
| 33 | } | |
| 34 | }; | |
| 35 | ||
| 36 | ||
| 37 | 1 | module.exports = Actions; |
| 38 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var FluxConstant = require('flux-constant'); |
| 2 | 1 | var PayloadSources = require('../../constants/PayloadSources'); |
| 3 | ||
| 4 | ||
| 5 | 1 | module.exports = { |
| 6 | PayloadSources: PayloadSources, | |
| 7 | ActionTypes: FluxConstant.set([ | |
| 8 | 'SEND_REQUEST', | |
| 9 | 'RECEIVE_RESPONSE' | |
| 10 | ]) | |
| 11 | }; | |
| 12 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | client/pages/signup/Form.jsx | 1 | |
| 2 | client/pages/signup/Form.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | client/pages/signup/Form.jsx | 1 |
| 4 | 1 | var ControlGroup = require('../../components/form/ControlGroup'); | client/pages/signup/Form.jsx | 2 |
| 5 | 1 | var TextControl = require('../../components/form/TextControl'); | client/pages/signup/Form.jsx | 3 |
| 6 | 1 | var Button = require('../../components/form/Button'); | client/pages/signup/Form.jsx | 4 |
| 7 | 1 | var Spinner = require('../../components/form/Spinner'); | client/pages/signup/Form.jsx | 5 |
| 8 | 1 | var Actions = require('./Actions'); | client/pages/signup/Form.jsx | 6 |
| 9 | 1 | var Store = require('./Store'); | client/pages/signup/Form.jsx | 7 |
| 10 | client/pages/signup/Form.jsx | 7 | ||
| 11 | 1 | var Component = React.createClass({ | client/pages/signup/Form.jsx | 10 |
| 12 | displayName: 'Component', | client/pages/signup/Form.jsx | 10 | |
| 13 | client/pages/signup/Form.jsx | 10 | ||
| 14 | mixins: [React.addons.LinkedStateMixin], | client/pages/signup/Form.jsx | 11 | |
| 15 | getInitialState: function getInitialState() { | client/pages/signup/Form.jsx | 12 | |
| 16 | client/pages/signup/Form.jsx | 12 | ||
| 17 | 8 | Store.reset(); | client/pages/signup/Form.jsx | 14 |
| 18 | 8 | return Store.getState(); | client/pages/signup/Form.jsx | 15 |
| 19 | }, | client/pages/signup/Form.jsx | 15 | |
| 20 | componentDidMount: function componentDidMount() { | client/pages/signup/Form.jsx | 17 | |
| 21 | client/pages/signup/Form.jsx | 17 | ||
| 22 | 8 | Store.addChangeListener(this.onStoreChange); | client/pages/signup/Form.jsx | 19 |
| 23 | 8 | this.refs.nameControl.refs.inputField.getDOMNode().focus(); | client/pages/signup/Form.jsx | 20 |
| 24 | }, | client/pages/signup/Form.jsx | 20 | |
| 25 | componentWillUnmount: function componentWillUnmount() { | client/pages/signup/Form.jsx | 22 | |
| 26 | client/pages/signup/Form.jsx | 22 | ||
| 27 | 2 | Store.removeChangeListener(this.onStoreChange); | client/pages/signup/Form.jsx | 24 |
| 28 | }, | client/pages/signup/Form.jsx | 24 | |
| 29 | onStoreChange: function onStoreChange() { | client/pages/signup/Form.jsx | 26 | |
| 30 | client/pages/signup/Form.jsx | 26 | ||
| 31 | 17 | this.setState(Store.getState()); | client/pages/signup/Form.jsx | 28 |
| 32 | }, | client/pages/signup/Form.jsx | 28 | |
| 33 | handleSubmit: function handleSubmit(event) { | client/pages/signup/Form.jsx | 30 | |
| 34 | client/pages/signup/Form.jsx | 30 | ||
| 35 | 1 | event.preventDefault(); | client/pages/signup/Form.jsx | 32 |
| 36 | 1 | event.stopPropagation(); | client/pages/signup/Form.jsx | 33 |
| 37 | client/pages/signup/Form.jsx | 33 | ||
| 38 | 1 | Actions.sendRequest({ | client/pages/signup/Form.jsx | 35 |
| 39 | name: this.state.name, | client/pages/signup/Form.jsx | 36 | |
| 40 | username: this.state.username, | client/pages/signup/Form.jsx | 37 | |
| 41 | password: this.state.password, | client/pages/signup/Form.jsx | 38 | |
| 42 | email: this.state.email | client/pages/signup/Form.jsx | 39 | |
| 43 | }); | client/pages/signup/Form.jsx | 39 | |
| 44 | }, | client/pages/signup/Form.jsx | 40 | |
| 45 | render: function render() { | client/pages/signup/Form.jsx | 42 | |
| 46 | client/pages/signup/Form.jsx | 42 | ||
| 47 | 25 | var alerts = []; | client/pages/signup/Form.jsx | 44 |
| 48 | 25 | if (this.state.success) { | client/pages/signup/Form.jsx | 45 |
| 49 | 5 | alerts.push(React.createElement( | client/pages/signup/Form.jsx | 46 |
| 50 | 'div', | client/pages/signup/Form.jsx | 46 | |
| 51 | { key: 'success', className: 'alert alert-success' }, | client/pages/signup/Form.jsx | 46 | |
| 52 | 'Success. Redirecting...' | client/pages/signup/Form.jsx | 46 | |
| 53 | )); | client/pages/signup/Form.jsx | 46 | |
| 54 | 20 | } else if (this.state.error) { | client/pages/signup/Form.jsx | 48 |
| 55 | 6 | alerts.push(React.createElement( | client/pages/signup/Form.jsx | 51 |
| 56 | 'div', | client/pages/signup/Form.jsx | 51 | |
| 57 | { key: 'danger', className: 'alert alert-danger' }, | client/pages/signup/Form.jsx | 51 | |
| 58 | this.state.error | client/pages/signup/Form.jsx | 51 | |
| 59 | )); | client/pages/signup/Form.jsx | 52 | |
| 60 | } | client/pages/signup/Form.jsx | 53 | |
| 61 | client/pages/signup/Form.jsx | 54 | ||
| 62 | 25 | var formElements; | client/pages/signup/Form.jsx | 56 |
| 63 | 25 | if (!this.state.success) { | client/pages/signup/Form.jsx | 57 |
| 64 | 20 | formElements = React.createElement( | client/pages/signup/Form.jsx | 58 |
| 65 | 'fieldset', | client/pages/signup/Form.jsx | 58 | |
| 66 | null, | client/pages/signup/Form.jsx | 58 | |
| 67 | React.createElement(TextControl, { | client/pages/signup/Form.jsx | 58 | |
| 68 | name: 'name', | client/pages/signup/Form.jsx | 60 | |
| 69 | label: 'Name', | client/pages/signup/Form.jsx | 61 | |
| 70 | ref: 'nameControl', | client/pages/signup/Form.jsx | 62 | |
| 71 | hasError: this.state.hasError.name, | client/pages/signup/Form.jsx | 63 | |
| 72 | valueLink: this.linkState('name'), | client/pages/signup/Form.jsx | 64 | |
| 73 | help: this.state.help.name, | client/pages/signup/Form.jsx | 65 | |
| 74 | disabled: this.state.loading | client/pages/signup/Form.jsx | 66 | |
| 75 | }), | client/pages/signup/Form.jsx | 66 | |
| 76 | React.createElement(TextControl, { | client/pages/signup/Form.jsx | 67 | |
| 77 | name: 'email', | client/pages/signup/Form.jsx | 69 | |
| 78 | label: 'Email', | client/pages/signup/Form.jsx | 70 | |
| 79 | hasError: this.state.hasError.email, | client/pages/signup/Form.jsx | 71 | |
| 80 | valueLink: this.linkState('email'), | client/pages/signup/Form.jsx | 72 | |
| 81 | help: this.state.help.email, | client/pages/signup/Form.jsx | 73 | |
| 82 | disabled: this.state.loading | client/pages/signup/Form.jsx | 74 | |
| 83 | }), | client/pages/signup/Form.jsx | 74 | |
| 84 | React.createElement(TextControl, { | client/pages/signup/Form.jsx | 75 | |
| 85 | name: 'username', | client/pages/signup/Form.jsx | 77 | |
| 86 | label: 'Username', | client/pages/signup/Form.jsx | 78 | |
| 87 | hasError: this.state.hasError.username, | client/pages/signup/Form.jsx | 79 | |
| 88 | valueLink: this.linkState('username'), | client/pages/signup/Form.jsx | 80 | |
| 89 | help: this.state.help.username, | client/pages/signup/Form.jsx | 81 | |
| 90 | disabled: this.state.loading | client/pages/signup/Form.jsx | 82 | |
| 91 | }), | client/pages/signup/Form.jsx | 82 | |
| 92 | React.createElement(TextControl, { | client/pages/signup/Form.jsx | 83 | |
| 93 | name: 'password', | client/pages/signup/Form.jsx | 85 | |
| 94 | label: 'Password', | client/pages/signup/Form.jsx | 86 | |
| 95 | type: 'password', | client/pages/signup/Form.jsx | 87 | |
| 96 | hasError: this.state.hasError.password, | client/pages/signup/Form.jsx | 88 | |
| 97 | valueLink: this.linkState('password'), | client/pages/signup/Form.jsx | 89 | |
| 98 | help: this.state.help.password, | client/pages/signup/Form.jsx | 90 | |
| 99 | disabled: this.state.loading | client/pages/signup/Form.jsx | 91 | |
| 100 | }), | client/pages/signup/Form.jsx | 91 | |
| 101 | React.createElement( | client/pages/signup/Form.jsx | 92 | |
| 102 | ControlGroup, | client/pages/signup/Form.jsx | 93 | |
| 103 | { hideLabel: true, hideHelp: true }, | client/pages/signup/Form.jsx | 93 | |
| 104 | React.createElement( | client/pages/signup/Form.jsx | 93 | |
| 105 | Button, | client/pages/signup/Form.jsx | 94 | |
| 106 | { | client/pages/signup/Form.jsx | 94 | |
| 107 | type: 'submit', | client/pages/signup/Form.jsx | 95 | |
| 108 | inputClasses: { 'btn-primary': true }, | client/pages/signup/Form.jsx | 96 | |
| 109 | disabled: this.state.loading }, | client/pages/signup/Form.jsx | 97 | |
| 110 | 'Create my account', | client/pages/signup/Form.jsx | 97 | |
| 111 | React.createElement(Spinner, { space: 'left', show: this.state.loading }) | client/pages/signup/Form.jsx | 97 | |
| 112 | ) | client/pages/signup/Form.jsx | 100 | |
| 113 | ) | client/pages/signup/Form.jsx | 101 | |
| 114 | ); | client/pages/signup/Form.jsx | 102 | |
| 115 | } | client/pages/signup/Form.jsx | 103 | |
| 116 | client/pages/signup/Form.jsx | 104 | ||
| 117 | 25 | return React.createElement( | client/pages/signup/Form.jsx | 106 |
| 118 | 'section', | client/pages/signup/Form.jsx | 107 | |
| 119 | null, | client/pages/signup/Form.jsx | 107 | |
| 120 | React.createElement( | client/pages/signup/Form.jsx | 107 | |
| 121 | 'h1', | client/pages/signup/Form.jsx | 108 | |
| 122 | { className: 'page-header' }, | client/pages/signup/Form.jsx | 108 | |
| 123 | 'Sign up' | client/pages/signup/Form.jsx | 108 | |
| 124 | ), | client/pages/signup/Form.jsx | 108 | |
| 125 | React.createElement( | client/pages/signup/Form.jsx | 108 | |
| 126 | 'form', | client/pages/signup/Form.jsx | 109 | |
| 127 | { onSubmit: this.handleSubmit }, | client/pages/signup/Form.jsx | 109 | |
| 128 | alerts, | client/pages/signup/Form.jsx | 109 | |
| 129 | formElements | client/pages/signup/Form.jsx | 110 | |
| 130 | ) | client/pages/signup/Form.jsx | 111 | |
| 131 | ); | client/pages/signup/Form.jsx | 112 | |
| 132 | } | client/pages/signup/Form.jsx | 114 | |
| 133 | }); | client/pages/signup/Form.jsx | 115 | |
| 134 | client/pages/signup/Form.jsx | 116 | ||
| 135 | 1 | module.exports = Component; | client/pages/signup/Form.jsx | 119 |
| 136 | client/pages/signup/Form.jsx | 119 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Dispatcher = require('flux-dispatcher'); |
| 2 | 1 | var FluxStore = require('flux-store'); |
| 3 | 1 | var CloneDeep = require('lodash/lang/cloneDeep'); |
| 4 | 1 | var Constants = require('./Constants'); |
| 5 | 1 | var ParseValidation = require('../../helpers/parseValidation'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var ActionTypes = Constants.ActionTypes; |
| 9 | ||
| 10 | ||
| 11 | 1 | var Store = FluxStore.extend({ |
| 12 | dispatcher: Dispatcher, | |
| 13 | state: {}, | |
| 14 | defaultState: { | |
| 15 | loading: false, | |
| 16 | success: false, | |
| 17 | error: undefined, | |
| 18 | hasError: {}, | |
| 19 | help: {} | |
| 20 | }, | |
| 21 | getState: function () { | |
| 22 | ||
| 23 | 30 | return this.state; |
| 24 | }, | |
| 25 | reset: function () { | |
| 26 | ||
| 27 | 9 | this.state = CloneDeep(this.defaultState); |
| 28 | }, | |
| 29 | onDispatcherAction: function (payload) { | |
| 30 | ||
| 31 | 157 | var action = payload.action; |
| 32 | ||
| 33 | 157 | if (ActionTypes.SEND_REQUEST === action.type) { |
| 34 | 2 | this.state.loading = true; |
| 35 | 2 | this.state.success = false; |
| 36 | 2 | this.state.error = undefined; |
| 37 | 2 | this.state.hasError = {}; |
| 38 | 2 | this.state.help = {}; |
| 39 | 2 | this.emitChange(); |
| 40 | } | |
| 41 | ||
| 42 | 157 | if (ActionTypes.RECEIVE_RESPONSE === action.type) { |
| 43 | 5 | var validation = ParseValidation(action.data.validation, action.data.message); |
| 44 | ||
| 45 | 5 | this.state.loading = false; |
| 46 | 5 | this.state.success = action.data.success; |
| 47 | 5 | this.state.hasError = validation.hasError; |
| 48 | 5 | this.state.help = validation.help; |
| 49 | 5 | this.state.error = validation.error; |
| 50 | ||
| 51 | 5 | this.emitChange(); |
| 52 | } | |
| 53 | } | |
| 54 | }); | |
| 55 | ||
| 56 | ||
| 57 | 1 | module.exports = Store; |
| 58 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | /* global window */ | client/pages/signup/index.jsx | 1 | |
| 2 | 'use strict'; | client/pages/signup/index.jsx | 2 | |
| 3 | client/pages/signup/index.jsx | 3 | ||
| 4 | 1 | var React = require('react/addons'); | client/pages/signup/index.jsx | 2 |
| 5 | 1 | var FormView = require('./Form'); | client/pages/signup/index.jsx | 3 |
| 6 | client/pages/signup/index.jsx | 3 | ||
| 7 | 1 | var App = { | client/pages/signup/index.jsx | 6 |
| 8 | blastoff: function blastoff() { | client/pages/signup/index.jsx | 7 | |
| 9 | client/pages/signup/index.jsx | 7 | ||
| 10 | 1 | this.mainElement = React.render(React.createElement(FormView, null), window.document.getElementById('app-mount')); | client/pages/signup/index.jsx | 9 |
| 11 | } | client/pages/signup/index.jsx | 12 | |
| 12 | }; | client/pages/signup/index.jsx | 13 | |
| 13 | client/pages/signup/index.jsx | 14 | ||
| 14 | 1 | module.exports = App; | client/pages/signup/index.jsx | 17 |
| 15 | client/pages/signup/index.jsx | 17 | ||
| 16 | /* $lab:coverage:off$ */ | client/pages/signup/index.jsx | 17 | |
| 17 | if (!module.parent) { | client/pages/signup/index.jsx | 21 | |
| 18 | window.app = App; | client/pages/signup/index.jsx | 22 | |
| 19 | App.blastoff(); | client/pages/signup/index.jsx | 23 | |
| 20 | } | client/pages/signup/index.jsx | 23 | |
| 21 | /* $lab:coverage:on$ */ | client/pages/signup/index.jsx | 24 | |
| 22 | client/pages/signup/index.jsx | 24 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Async = require('async'); |
| 2 | 1 | var Config = require('../config'); |
| 3 | ||
| 4 | ||
| 5 | 1 | exports.register = function (server, options, next) { |
| 6 | ||
| 7 | 22 | var Session = server.plugins['hapi-mongo-models'].Session; |
| 8 | 22 | var User = server.plugins['hapi-mongo-models'].User; |
| 9 | ||
| 10 | ||
| 11 | 22 | server.auth.strategy('session', 'cookie', { |
| 12 | password: Config.get('/cookieSecret'), | |
| 13 | cookie: 'sid-aqua', | |
| 14 | isSecure: false, | |
| 15 | redirectTo: '/login', | |
| 16 | validateFunc: function (request, data, callback) { | |
| 17 | ||
| 18 | 8 | Async.auto({ |
| 19 | session: function (done) { | |
| 20 | ||
| 21 | 8 | var id = data.session._id; |
| 22 | 8 | var key = data.session.key; |
| 23 | 8 | Session.findByCredentials(id, key, done); |
| 24 | }, | |
| 25 | user: ['session', function (done, results) { | |
| 26 | ||
| 27 | 7 | if (!results.session) { |
| 28 | 1 | return done(); |
| 29 | } | |
| 30 | ||
| 31 | 6 | User.findById(results.session.userId, done); |
| 32 | }], | |
| 33 | roles: ['user', function (done, results) { | |
| 34 | ||
| 35 | 7 | if (!results.user) { |
| 36 | 2 | return done(); |
| 37 | } | |
| 38 | ||
| 39 | 5 | results.user.hydrateRoles(done); |
| 40 | }], | |
| 41 | scope: ['user', function (done, results) { | |
| 42 | ||
| 43 | 7 | if (!results.user || !results.user.roles) { |
| 44 | 4 | return done(); |
| 45 | } | |
| 46 | ||
| 47 | 3 | done(null, Object.keys(results.user.roles)); |
| 48 | }] | |
| 49 | }, function (err, results) { | |
| 50 | ||
| 51 | 8 | if (err) { |
| 52 | 1 | return callback(err); |
| 53 | } | |
| 54 | ||
| 55 | 7 | if (!results.session) { |
| 56 | 1 | return callback(null, false); |
| 57 | } | |
| 58 | ||
| 59 | 6 | callback(null, Boolean(results.user), results); |
| 60 | }); | |
| 61 | } | |
| 62 | }); | |
| 63 | ||
| 64 | ||
| 65 | 22 | next(); |
| 66 | }; | |
| 67 | ||
| 68 | ||
| 69 | 1 | exports.preware = {}; |
| 70 | ||
| 71 | ||
| 72 | 1 | exports.preware.ensureAdminGroup = function (groups) { |
| 73 | ||
| 74 | 68 | return { |
| 75 | assign: 'ensureAdminGroup', | |
| 76 | method: function (request, reply) { | |
| 77 | ||
| 78 | 110 | if (Object.prototype.toString.call(groups) !== '[object Array]') { |
| 79 | 34 | groups = [groups]; |
| 80 | } | |
| 81 | ||
| 82 | 110 | var groupFound = groups.some(function (group) { |
| 83 | ||
| 84 | 111 | return request.auth.credentials.roles.admin.isMemberOf(group); |
| 85 | }); | |
| 86 | ||
| 87 | 110 | if (!groupFound) { |
| 88 | 1 | var response = { |
| 89 | message: 'Permission denied to this resource.' | |
| 90 | }; | |
| 91 | ||
| 92 | 1 | return reply(response).takeover().code(403); |
| 93 | } | |
| 94 | ||
| 95 | 109 | reply(); |
| 96 | } | |
| 97 | }; | |
| 98 | }; | |
| 99 | ||
| 100 | ||
| 101 | 1 | exports.register.attributes = { |
| 102 | name: 'auth' | |
| 103 | }; | |
| 104 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Hoek = require('hoek'); |
| 2 | 1 | var Fs = require('fs'); |
| 3 | 1 | var Handlebars = require('handlebars'); |
| 4 | 1 | var Nodemailer = require('nodemailer'); |
| 5 | 1 | var Markdown = require('nodemailer-markdown').markdown; |
| 6 | 1 | var Config = require('../config'); |
| 7 | ||
| 8 | ||
| 9 | 1 | var transport = Nodemailer.createTransport(Config.get('/nodemailer')); |
| 10 | 1 | transport.use('compile', Markdown({ useEmbeddedImages: true })); |
| 11 | ||
| 12 | ||
| 13 | 1 | var templateCache = {}; |
| 14 | ||
| 15 | ||
| 16 | 1 | var renderTemplate = function (signature, context, callback) { |
| 17 | ||
| 18 | 3 | if (templateCache[signature]) { |
| 19 | 1 | return callback(null, templateCache[signature](context)); |
| 20 | } | |
| 21 | ||
| 22 | 2 | var filePath = __dirname + '/emails/' + signature + '.hbs.md'; |
| 23 | 2 | var options = { encoding: 'utf-8' }; |
| 24 | ||
| 25 | 2 | Fs.readFile(filePath, options, function (err, source) { |
| 26 | ||
| 27 | 2 | if (err) { |
| 28 | 1 | return callback(err); |
| 29 | } | |
| 30 | ||
| 31 | 1 | templateCache[signature] = Handlebars.compile(source); |
| 32 | 1 | callback(null, templateCache[signature](context)); |
| 33 | }); | |
| 34 | }; | |
| 35 | ||
| 36 | ||
| 37 | 1 | var sendEmail = exports.sendEmail = function (options, template, context, callback) { |
| 38 | ||
| 39 | 3 | renderTemplate(template, context, function (err, content) { |
| 40 | ||
| 41 | 3 | if (err) { |
| 42 | 1 | return callback(err); |
| 43 | } | |
| 44 | ||
| 45 | 2 | options = Hoek.applyToDefaults(options, { |
| 46 | from: Config.get('/system/fromAddress'), | |
| 47 | markdown: content | |
| 48 | }); | |
| 49 | ||
| 50 | 2 | transport.sendMail(options, callback); |
| 51 | }); | |
| 52 | }; | |
| 53 | ||
| 54 | ||
| 55 | 1 | exports.register = function (server, options, next) { |
| 56 | ||
| 57 | 6 | server.expose('sendEmail', sendEmail); |
| 58 | 6 | server.expose('transport', transport); |
| 59 | ||
| 60 | 6 | next(); |
| 61 | }; | |
| 62 | ||
| 63 | ||
| 64 | 1 | exports.register.attributes = { |
| 65 | name: 'mailer' | |
| 66 | }; | |
| 67 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Async = require('async'); |
| 2 | 1 | var Joi = require('joi'); |
| 3 | 1 | var Hoek = require('hoek'); |
| 4 | 1 | var AuthPlugin = require('../auth'); |
| 5 | ||
| 6 | ||
| 7 | 1 | exports.register = function (server, options, next) { |
| 8 | ||
| 9 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 10 | ||
| 11 | ||
| 12 | 2 | server.route({ |
| 13 | method: 'GET', | |
| 14 | path: options.basePath + '/accounts', | |
| 15 | config: { | |
| 16 | auth: { | |
| 17 | strategy: 'session', | |
| 18 | scope: 'admin' | |
| 19 | }, | |
| 20 | validate: { | |
| 21 | query: { | |
| 22 | username: Joi.string().allow(''), | |
| 23 | fields: Joi.string(), | |
| 24 | sort: Joi.string().default('_id'), | |
| 25 | limit: Joi.number().default(20), | |
| 26 | page: Joi.number().default(1) | |
| 27 | } | |
| 28 | } | |
| 29 | }, | |
| 30 | handler: function (request, reply) { | |
| 31 | ||
| 32 | 3 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 33 | 3 | var query = {}; |
| 34 | 3 | if (request.query.username) { |
| 35 | 1 | query['user.name'] = new RegExp('^.*?' + request.query.username + '.*$', 'i'); |
| 36 | } | |
| 37 | 3 | var fields = request.query.fields; |
| 38 | 3 | var sort = request.query.sort; |
| 39 | 3 | var limit = request.query.limit; |
| 40 | 3 | var page = request.query.page; |
| 41 | ||
| 42 | 3 | Account.pagedFind(query, fields, sort, limit, page, function (err, results) { |
| 43 | ||
| 44 | 3 | if (err) { |
| 45 | 1 | return reply(err); |
| 46 | } | |
| 47 | ||
| 48 | 2 | reply(results); |
| 49 | }); | |
| 50 | } | |
| 51 | }); | |
| 52 | ||
| 53 | ||
| 54 | 2 | server.route({ |
| 55 | method: 'GET', | |
| 56 | path: options.basePath + '/accounts/{id}', | |
| 57 | config: { | |
| 58 | auth: { | |
| 59 | strategy: 'session', | |
| 60 | scope: 'admin' | |
| 61 | } | |
| 62 | }, | |
| 63 | handler: function (request, reply) { | |
| 64 | ||
| 65 | 3 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 66 | ||
| 67 | 3 | Account.findById(request.params.id, function (err, account) { |
| 68 | ||
| 69 | 3 | if (err) { |
| 70 | 1 | return reply(err); |
| 71 | } | |
| 72 | ||
| 73 | 2 | if (!account) { |
| 74 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 75 | } | |
| 76 | ||
| 77 | 1 | reply(account); |
| 78 | }); | |
| 79 | } | |
| 80 | }); | |
| 81 | ||
| 82 | ||
| 83 | 2 | server.route({ |
| 84 | method: 'GET', | |
| 85 | path: options.basePath + '/accounts/my', | |
| 86 | config: { | |
| 87 | auth: { | |
| 88 | strategy: 'session', | |
| 89 | scope: 'account' | |
| 90 | } | |
| 91 | }, | |
| 92 | handler: function (request, reply) { | |
| 93 | ||
| 94 | 3 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 95 | 3 | var id = request.auth.credentials.roles.account._id.toString(); |
| 96 | 3 | var fields = Account.fieldsAdapter('user name timeCreated'); |
| 97 | ||
| 98 | 3 | Account.findById(id, fields, function (err, account) { |
| 99 | ||
| 100 | 3 | if (err) { |
| 101 | 1 | return reply(err); |
| 102 | } | |
| 103 | ||
| 104 | 2 | if (!account) { |
| 105 | 1 | return reply({ message: 'Document not found. That is strange.' }).code(404); |
| 106 | } | |
| 107 | ||
| 108 | 1 | reply(account); |
| 109 | }); | |
| 110 | } | |
| 111 | }); | |
| 112 | ||
| 113 | ||
| 114 | 2 | server.route({ |
| 115 | method: 'POST', | |
| 116 | path: options.basePath + '/accounts', | |
| 117 | config: { | |
| 118 | auth: { | |
| 119 | strategy: 'session', | |
| 120 | scope: 'admin' | |
| 121 | }, | |
| 122 | validate: { | |
| 123 | payload: { | |
| 124 | name: Joi.string().required() | |
| 125 | } | |
| 126 | } | |
| 127 | }, | |
| 128 | handler: function (request, reply) { | |
| 129 | ||
| 130 | 2 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 131 | 2 | var name = request.payload.name; |
| 132 | ||
| 133 | 2 | Account.create(name, function (err, account) { |
| 134 | ||
| 135 | 2 | if (err) { |
| 136 | 1 | return reply(err); |
| 137 | } | |
| 138 | ||
| 139 | 1 | reply(account); |
| 140 | }); | |
| 141 | } | |
| 142 | }); | |
| 143 | ||
| 144 | ||
| 145 | 2 | server.route({ |
| 146 | method: 'PUT', | |
| 147 | path: options.basePath + '/accounts/{id}', | |
| 148 | config: { | |
| 149 | auth: { | |
| 150 | strategy: 'session', | |
| 151 | scope: 'admin' | |
| 152 | }, | |
| 153 | validate: { | |
| 154 | payload: { | |
| 155 | nameFirst: Joi.string().required(), | |
| 156 | nameMiddle: Joi.string().allow('', null), | |
| 157 | nameLast: Joi.string().required() | |
| 158 | } | |
| 159 | } | |
| 160 | }, | |
| 161 | handler: function (request, reply) { | |
| 162 | ||
| 163 | 3 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 164 | 3 | var id = request.params.id; |
| 165 | 3 | var update = { |
| 166 | $set: { | |
| 167 | name: { | |
| 168 | first: request.payload.nameFirst, | |
| 169 | middle: request.payload.nameMiddle, | |
| 170 | last: request.payload.nameLast | |
| 171 | } | |
| 172 | } | |
| 173 | }; | |
| 174 | ||
| 175 | 3 | Account.findByIdAndUpdate(id, update, function (err, account) { |
| 176 | ||
| 177 | 3 | if (err) { |
| 178 | 1 | return reply(err); |
| 179 | } | |
| 180 | ||
| 181 | 2 | if (!account) { |
| 182 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 183 | } | |
| 184 | ||
| 185 | 1 | reply(account); |
| 186 | }); | |
| 187 | } | |
| 188 | }); | |
| 189 | ||
| 190 | ||
| 191 | 2 | server.route({ |
| 192 | method: 'PUT', | |
| 193 | path: options.basePath + '/accounts/my', | |
| 194 | config: { | |
| 195 | auth: { | |
| 196 | strategy: 'session', | |
| 197 | scope: 'account' | |
| 198 | }, | |
| 199 | validate: { | |
| 200 | payload: { | |
| 201 | nameFirst: Joi.string().required(), | |
| 202 | nameMiddle: Joi.string().allow(''), | |
| 203 | nameLast: Joi.string().required() | |
| 204 | } | |
| 205 | } | |
| 206 | }, | |
| 207 | handler: function (request, reply) { | |
| 208 | ||
| 209 | 2 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 210 | 2 | var id = request.auth.credentials.roles.account._id.toString(); |
| 211 | 2 | var update = { |
| 212 | $set: { | |
| 213 | name: { | |
| 214 | first: request.payload.nameFirst, | |
| 215 | middle: request.payload.nameMiddle, | |
| 216 | last: request.payload.nameLast | |
| 217 | } | |
| 218 | } | |
| 219 | }; | |
| 220 | 2 | var findOptions = { |
| 221 | fields: Account.fieldsAdapter('user name timeCreated') | |
| 222 | }; | |
| 223 | ||
| 224 | 2 | Account.findByIdAndUpdate(id, update, findOptions, function (err, account) { |
| 225 | ||
| 226 | 2 | if (err) { |
| 227 | 1 | return reply(err); |
| 228 | } | |
| 229 | ||
| 230 | 1 | reply(account); |
| 231 | }); | |
| 232 | } | |
| 233 | }); | |
| 234 | ||
| 235 | ||
| 236 | 2 | server.route({ |
| 237 | method: 'PUT', | |
| 238 | path: options.basePath + '/accounts/{id}/user', | |
| 239 | config: { | |
| 240 | auth: { | |
| 241 | strategy: 'session', | |
| 242 | scope: 'admin' | |
| 243 | }, | |
| 244 | validate: { | |
| 245 | payload: { | |
| 246 | username: Joi.string().lowercase().required() | |
| 247 | } | |
| 248 | }, | |
| 249 | pre: [{ | |
| 250 | assign: 'account', | |
| 251 | method: function (request, reply) { | |
| 252 | ||
| 253 | 8 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 254 | ||
| 255 | 8 | Account.findById(request.params.id, function (err, account) { |
| 256 | ||
| 257 | 8 | if (err) { |
| 258 | 1 | return reply(err); |
| 259 | } | |
| 260 | ||
| 261 | 7 | if (!account) { |
| 262 | 1 | return reply({ message: 'Document not found.' }).takeover().code(404); |
| 263 | } | |
| 264 | ||
| 265 | 6 | reply(account); |
| 266 | }); | |
| 267 | } | |
| 268 | }, { | |
| 269 | assign: 'user', | |
| 270 | method: function (request, reply) { | |
| 271 | ||
| 272 | 6 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 273 | ||
| 274 | 6 | User.findByUsername(request.payload.username, function (err, user) { |
| 275 | ||
| 276 | 6 | if (err) { |
| 277 | 1 | return reply(err); |
| 278 | } | |
| 279 | ||
| 280 | 5 | if (!user) { |
| 281 | 1 | return reply({ message: 'User document not found.' }).takeover().code(404); |
| 282 | } | |
| 283 | ||
| 284 | 4 | if (user.roles && |
| 285 | user.roles.account && | |
| 286 | user.roles.account.id !== request.params.id) { | |
| 287 | ||
| 288 | 1 | var response = { |
| 289 | message: 'User is already linked to another account. Unlink first.' | |
| 290 | }; | |
| 291 | ||
| 292 | 1 | return reply(response).takeover().code(409); |
| 293 | } | |
| 294 | ||
| 295 | 3 | reply(user); |
| 296 | }); | |
| 297 | } | |
| 298 | }, { | |
| 299 | assign: 'userCheck', | |
| 300 | method: function (request, reply) { | |
| 301 | ||
| 302 | 3 | if (request.pre.account.user && |
| 303 | request.pre.account.user.id !== request.pre.user._id.toString()) { | |
| 304 | ||
| 305 | 1 | var response = { |
| 306 | message: 'Account is already linked to another user. Unlink first.' | |
| 307 | }; | |
| 308 | ||
| 309 | 1 | return reply(response).takeover().code(409); |
| 310 | } | |
| 311 | ||
| 312 | 2 | reply(true); |
| 313 | } | |
| 314 | }] | |
| 315 | }, | |
| 316 | handler: function (request, reply) { | |
| 317 | ||
| 318 | 2 | Async.auto({ |
| 319 | account: function (done) { | |
| 320 | ||
| 321 | 2 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 322 | 2 | var id = request.params.id; |
| 323 | 2 | var update = { |
| 324 | $set: { | |
| 325 | user: { | |
| 326 | id: request.pre.user._id.toString(), | |
| 327 | name: request.pre.user.username | |
| 328 | } | |
| 329 | } | |
| 330 | }; | |
| 331 | ||
| 332 | 2 | Account.findByIdAndUpdate(id, update, done); |
| 333 | }, | |
| 334 | user: function (done) { | |
| 335 | ||
| 336 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 337 | 2 | var id = request.pre.user._id; |
| 338 | 2 | var update = { |
| 339 | $set: { | |
| 340 | 'roles.account': { | |
| 341 | id: request.pre.account._id.toString(), | |
| 342 | name: request.pre.account.name.first + ' ' + request.pre.account.name.last | |
| 343 | } | |
| 344 | } | |
| 345 | }; | |
| 346 | ||
| 347 | 2 | User.findByIdAndUpdate(id, update, done); |
| 348 | } | |
| 349 | }, function (err, results) { | |
| 350 | ||
| 351 | 2 | if (err) { |
| 352 | 1 | return reply(err); |
| 353 | } | |
| 354 | ||
| 355 | 1 | reply(results.account); |
| 356 | }); | |
| 357 | } | |
| 358 | }); | |
| 359 | ||
| 360 | ||
| 361 | 2 | server.route({ |
| 362 | method: 'DELETE', | |
| 363 | path: options.basePath + '/accounts/{id}/user', | |
| 364 | config: { | |
| 365 | auth: { | |
| 366 | strategy: 'session', | |
| 367 | scope: 'admin' | |
| 368 | }, | |
| 369 | pre: [{ | |
| 370 | assign: 'account', | |
| 371 | method: function (request, reply) { | |
| 372 | ||
| 373 | 8 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 374 | ||
| 375 | 8 | Account.findById(request.params.id, function (err, account) { |
| 376 | ||
| 377 | 8 | if (err) { |
| 378 | 1 | return reply(err); |
| 379 | } | |
| 380 | ||
| 381 | 7 | if (!account) { |
| 382 | 1 | return reply({ message: 'Document not found.' }).takeover().code(404); |
| 383 | } | |
| 384 | ||
| 385 | 6 | if (!account.user || !account.user.id) { |
| 386 | 2 | return reply(account).takeover(); |
| 387 | } | |
| 388 | ||
| 389 | 4 | reply(account); |
| 390 | }); | |
| 391 | } | |
| 392 | }, { | |
| 393 | assign: 'user', | |
| 394 | method: function (request, reply) { | |
| 395 | ||
| 396 | 4 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 397 | ||
| 398 | 4 | User.findById(request.pre.account.user.id, function (err, user) { |
| 399 | ||
| 400 | 4 | if (err) { |
| 401 | 1 | return reply(err); |
| 402 | } | |
| 403 | ||
| 404 | 3 | if (!user) { |
| 405 | 1 | return reply({ message: 'User document not found.' }).takeover().code(404); |
| 406 | } | |
| 407 | ||
| 408 | 2 | reply(user); |
| 409 | }); | |
| 410 | } | |
| 411 | }] | |
| 412 | }, | |
| 413 | handler: function (request, reply) { | |
| 414 | ||
| 415 | 2 | Async.auto({ |
| 416 | account: function (done) { | |
| 417 | ||
| 418 | 2 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 419 | 2 | var id = request.params.id; |
| 420 | 2 | var update = { |
| 421 | $unset: { | |
| 422 | user: undefined | |
| 423 | } | |
| 424 | }; | |
| 425 | ||
| 426 | 2 | Account.findByIdAndUpdate(id, update, done); |
| 427 | }, | |
| 428 | user: function (done) { | |
| 429 | ||
| 430 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 431 | 2 | var id = request.pre.user._id.toString(); |
| 432 | 2 | var update = { |
| 433 | $unset: { | |
| 434 | 'roles.account': undefined | |
| 435 | } | |
| 436 | }; | |
| 437 | ||
| 438 | 2 | User.findByIdAndUpdate(id, update, done); |
| 439 | } | |
| 440 | }, function (err, results) { | |
| 441 | ||
| 442 | 2 | if (err) { |
| 443 | 1 | return reply(err); |
| 444 | } | |
| 445 | ||
| 446 | 1 | reply(results.account); |
| 447 | }); | |
| 448 | } | |
| 449 | }); | |
| 450 | ||
| 451 | ||
| 452 | 2 | server.route({ |
| 453 | method: 'POST', | |
| 454 | path: options.basePath + '/accounts/{id}/notes', | |
| 455 | config: { | |
| 456 | auth: { | |
| 457 | strategy: 'session', | |
| 458 | scope: 'admin' | |
| 459 | }, | |
| 460 | validate: { | |
| 461 | payload: { | |
| 462 | data: Joi.string().required() | |
| 463 | } | |
| 464 | } | |
| 465 | }, | |
| 466 | handler: function (request, reply) { | |
| 467 | ||
| 468 | 2 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 469 | 2 | var id = request.params.id; |
| 470 | 2 | var update = { |
| 471 | $push: { | |
| 472 | notes: { | |
| 473 | data: request.payload.data, | |
| 474 | timeCreated: new Date(), | |
| 475 | userCreated: { | |
| 476 | id: request.auth.credentials.user._id.toString(), | |
| 477 | name: request.auth.credentials.user.username | |
| 478 | } | |
| 479 | } | |
| 480 | } | |
| 481 | }; | |
| 482 | ||
| 483 | 2 | Account.findByIdAndUpdate(id, update, function (err, account) { |
| 484 | ||
| 485 | 2 | if (err) { |
| 486 | 1 | return reply(err); |
| 487 | } | |
| 488 | ||
| 489 | 1 | reply(account); |
| 490 | }); | |
| 491 | } | |
| 492 | }); | |
| 493 | ||
| 494 | ||
| 495 | 2 | server.route({ |
| 496 | method: 'POST', | |
| 497 | path: options.basePath + '/accounts/{id}/status', | |
| 498 | config: { | |
| 499 | auth: { | |
| 500 | strategy: 'session', | |
| 501 | scope: 'admin' | |
| 502 | }, | |
| 503 | validate: { | |
| 504 | payload: { | |
| 505 | status: Joi.string().required() | |
| 506 | } | |
| 507 | }, | |
| 508 | pre: [{ | |
| 509 | assign: 'status', | |
| 510 | method: function (request, reply) { | |
| 511 | ||
| 512 | 3 | var Status = request.server.plugins['hapi-mongo-models'].Status; |
| 513 | ||
| 514 | 3 | Status.findById(request.payload.status, function (err, status) { |
| 515 | ||
| 516 | 3 | if (err) { |
| 517 | 1 | return reply(err); |
| 518 | } | |
| 519 | ||
| 520 | 2 | reply(status); |
| 521 | }); | |
| 522 | } | |
| 523 | }] | |
| 524 | }, | |
| 525 | handler: function (request, reply) { | |
| 526 | ||
| 527 | 2 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 528 | 2 | var id = request.params.id; |
| 529 | 2 | var newStatus = { |
| 530 | id: request.pre.status._id.toString(), | |
| 531 | name: request.pre.status.name, | |
| 532 | timeCreated: new Date(), | |
| 533 | userCreated: { | |
| 534 | id: request.auth.credentials.user._id.toString(), | |
| 535 | name: request.auth.credentials.user.username | |
| 536 | } | |
| 537 | }; | |
| 538 | 2 | var update = { |
| 539 | $set: { | |
| 540 | 'status.current': newStatus | |
| 541 | }, | |
| 542 | $push: { | |
| 543 | 'status.log': newStatus | |
| 544 | } | |
| 545 | }; | |
| 546 | ||
| 547 | 2 | Account.findByIdAndUpdate(id, update, function (err, account) { |
| 548 | ||
| 549 | 2 | if (err) { |
| 550 | 1 | return reply(err); |
| 551 | } | |
| 552 | ||
| 553 | 1 | reply(account); |
| 554 | }); | |
| 555 | } | |
| 556 | }); | |
| 557 | ||
| 558 | ||
| 559 | 2 | server.route({ |
| 560 | method: 'DELETE', | |
| 561 | path: options.basePath + '/accounts/{id}', | |
| 562 | config: { | |
| 563 | auth: { | |
| 564 | strategy: 'session', | |
| 565 | scope: 'admin' | |
| 566 | }, | |
| 567 | pre: [ | |
| 568 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 569 | ] | |
| 570 | }, | |
| 571 | handler: function (request, reply) { | |
| 572 | ||
| 573 | 3 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 574 | ||
| 575 | 3 | Account.findByIdAndDelete(request.params.id, function (err, account) { |
| 576 | ||
| 577 | 3 | if (err) { |
| 578 | 1 | return reply(err); |
| 579 | } | |
| 580 | ||
| 581 | 2 | if (!account) { |
| 582 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 583 | } | |
| 584 | ||
| 585 | 1 | reply({ message: 'Success.' }); |
| 586 | }); | |
| 587 | } | |
| 588 | }); | |
| 589 | ||
| 590 | ||
| 591 | 2 | next(); |
| 592 | }; | |
| 593 | ||
| 594 | ||
| 595 | 1 | exports.register.attributes = { |
| 596 | name: 'account' | |
| 597 | }; | |
| 598 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var AuthPlugin = require('../auth'); |
| 4 | ||
| 5 | ||
| 6 | 1 | exports.register = function (server, options, next) { |
| 7 | ||
| 8 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 9 | ||
| 10 | ||
| 11 | 2 | server.route({ |
| 12 | method: 'GET', | |
| 13 | path: options.basePath + '/admin-groups', | |
| 14 | config: { | |
| 15 | auth: { | |
| 16 | strategy: 'session', | |
| 17 | scope: 'admin' | |
| 18 | }, | |
| 19 | validate: { | |
| 20 | query: { | |
| 21 | name: Joi.string().allow(''), | |
| 22 | fields: Joi.string(), | |
| 23 | sort: Joi.string().default('_id'), | |
| 24 | limit: Joi.number().default(20), | |
| 25 | page: Joi.number().default(1) | |
| 26 | } | |
| 27 | }, | |
| 28 | pre: [ | |
| 29 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 30 | ] | |
| 31 | }, | |
| 32 | handler: function (request, reply) { | |
| 33 | ||
| 34 | 3 | var AdminGroup = request.server.plugins['hapi-mongo-models'].AdminGroup; |
| 35 | 3 | var query = {}; |
| 36 | 3 | if (request.query.name) { |
| 37 | 1 | query.name = new RegExp('^.*?' + request.query.name + '.*$', 'i'); |
| 38 | } | |
| 39 | 3 | var fields = request.query.fields; |
| 40 | 3 | var sort = request.query.sort; |
| 41 | 3 | var limit = request.query.limit; |
| 42 | 3 | var page = request.query.page; |
| 43 | ||
| 44 | 3 | AdminGroup.pagedFind(query, fields, sort, limit, page, function (err, results) { |
| 45 | ||
| 46 | 3 | if (err) { |
| 47 | 1 | return reply(err); |
| 48 | } | |
| 49 | ||
| 50 | 2 | reply(results); |
| 51 | }); | |
| 52 | } | |
| 53 | }); | |
| 54 | ||
| 55 | ||
| 56 | 2 | server.route({ |
| 57 | method: 'GET', | |
| 58 | path: options.basePath + '/admin-groups/{id}', | |
| 59 | config: { | |
| 60 | auth: { | |
| 61 | strategy: 'session', | |
| 62 | scope: 'admin' | |
| 63 | }, | |
| 64 | pre: [ | |
| 65 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 66 | ] | |
| 67 | }, | |
| 68 | handler: function (request, reply) { | |
| 69 | ||
| 70 | 3 | var AdminGroup = request.server.plugins['hapi-mongo-models'].AdminGroup; |
| 71 | ||
| 72 | 3 | AdminGroup.findById(request.params.id, function (err, adminGroup) { |
| 73 | ||
| 74 | 3 | if (err) { |
| 75 | 1 | return reply(err); |
| 76 | } | |
| 77 | ||
| 78 | 2 | if (!adminGroup) { |
| 79 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 80 | } | |
| 81 | ||
| 82 | 1 | reply(adminGroup); |
| 83 | }); | |
| 84 | } | |
| 85 | }); | |
| 86 | ||
| 87 | ||
| 88 | 2 | server.route({ |
| 89 | method: 'POST', | |
| 90 | path: options.basePath + '/admin-groups', | |
| 91 | config: { | |
| 92 | auth: { | |
| 93 | strategy: 'session', | |
| 94 | scope: 'admin' | |
| 95 | }, | |
| 96 | validate: { | |
| 97 | payload: { | |
| 98 | name: Joi.string().required() | |
| 99 | } | |
| 100 | }, | |
| 101 | pre: [ | |
| 102 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 103 | ] | |
| 104 | }, | |
| 105 | handler: function (request, reply) { | |
| 106 | ||
| 107 | 2 | var AdminGroup = request.server.plugins['hapi-mongo-models'].AdminGroup; |
| 108 | 2 | var name = request.payload.name; |
| 109 | ||
| 110 | 2 | AdminGroup.create(name, function (err, adminGroup) { |
| 111 | ||
| 112 | 2 | if (err) { |
| 113 | 1 | return reply(err); |
| 114 | } | |
| 115 | ||
| 116 | 1 | reply(adminGroup); |
| 117 | }); | |
| 118 | } | |
| 119 | }); | |
| 120 | ||
| 121 | ||
| 122 | 2 | server.route({ |
| 123 | method: 'PUT', | |
| 124 | path: options.basePath + '/admin-groups/{id}', | |
| 125 | config: { | |
| 126 | auth: { | |
| 127 | strategy: 'session', | |
| 128 | scope: 'admin' | |
| 129 | }, | |
| 130 | validate: { | |
| 131 | payload: { | |
| 132 | name: Joi.string().required() | |
| 133 | } | |
| 134 | }, | |
| 135 | pre: [ | |
| 136 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 137 | ] | |
| 138 | }, | |
| 139 | handler: function (request, reply) { | |
| 140 | ||
| 141 | 3 | var AdminGroup = request.server.plugins['hapi-mongo-models'].AdminGroup; |
| 142 | 3 | var id = request.params.id; |
| 143 | 3 | var update = { |
| 144 | $set: { | |
| 145 | name: request.payload.name | |
| 146 | } | |
| 147 | }; | |
| 148 | ||
| 149 | 3 | AdminGroup.findByIdAndUpdate(id, update, function (err, adminGroup) { |
| 150 | ||
| 151 | 3 | if (err) { |
| 152 | 1 | return reply(err); |
| 153 | } | |
| 154 | ||
| 155 | 2 | if (!adminGroup) { |
| 156 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 157 | } | |
| 158 | ||
| 159 | 1 | reply(adminGroup); |
| 160 | }); | |
| 161 | } | |
| 162 | }); | |
| 163 | ||
| 164 | ||
| 165 | 2 | server.route({ |
| 166 | method: 'PUT', | |
| 167 | path: options.basePath + '/admin-groups/{id}/permissions', | |
| 168 | config: { | |
| 169 | auth: { | |
| 170 | strategy: 'session', | |
| 171 | scope: 'admin' | |
| 172 | }, | |
| 173 | validate: { | |
| 174 | payload: { | |
| 175 | permissions: Joi.object().required() | |
| 176 | } | |
| 177 | }, | |
| 178 | pre: [ | |
| 179 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 180 | ] | |
| 181 | }, | |
| 182 | handler: function (request, reply) { | |
| 183 | ||
| 184 | 2 | var AdminGroup = request.server.plugins['hapi-mongo-models'].AdminGroup; |
| 185 | 2 | var id = request.params.id; |
| 186 | 2 | var update = { |
| 187 | $set: { | |
| 188 | permissions: request.payload.permissions | |
| 189 | } | |
| 190 | }; | |
| 191 | ||
| 192 | 2 | AdminGroup.findByIdAndUpdate(id, update, function (err, adminGroup) { |
| 193 | ||
| 194 | 2 | if (err) { |
| 195 | 1 | return reply(err); |
| 196 | } | |
| 197 | ||
| 198 | 1 | reply(adminGroup); |
| 199 | }); | |
| 200 | } | |
| 201 | }); | |
| 202 | ||
| 203 | ||
| 204 | 2 | server.route({ |
| 205 | method: 'DELETE', | |
| 206 | path: options.basePath + '/admin-groups/{id}', | |
| 207 | config: { | |
| 208 | auth: { | |
| 209 | strategy: 'session', | |
| 210 | scope: 'admin' | |
| 211 | }, | |
| 212 | pre: [ | |
| 213 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 214 | ] | |
| 215 | }, | |
| 216 | handler: function (request, reply) { | |
| 217 | ||
| 218 | 3 | var AdminGroup = request.server.plugins['hapi-mongo-models'].AdminGroup; |
| 219 | ||
| 220 | 3 | AdminGroup.findByIdAndDelete(request.params.id, function (err, adminGroup) { |
| 221 | ||
| 222 | 3 | if (err) { |
| 223 | 1 | return reply(err); |
| 224 | } | |
| 225 | ||
| 226 | 2 | if (!adminGroup) { |
| 227 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 228 | } | |
| 229 | ||
| 230 | 1 | reply({ message: 'Success.' }); |
| 231 | }); | |
| 232 | } | |
| 233 | }); | |
| 234 | ||
| 235 | ||
| 236 | 2 | next(); |
| 237 | }; | |
| 238 | ||
| 239 | ||
| 240 | 1 | exports.register.attributes = { |
| 241 | name: 'admin-groups' | |
| 242 | }; | |
| 243 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Async = require('async'); |
| 2 | 1 | var Joi = require('joi'); |
| 3 | 1 | var Hoek = require('hoek'); |
| 4 | 1 | var AuthPlugin = require('../auth'); |
| 5 | ||
| 6 | ||
| 7 | 1 | exports.register = function (server, options, next) { |
| 8 | ||
| 9 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 10 | ||
| 11 | ||
| 12 | 2 | server.route({ |
| 13 | method: 'GET', | |
| 14 | path: options.basePath + '/admins', | |
| 15 | config: { | |
| 16 | auth: { | |
| 17 | strategy: 'session', | |
| 18 | scope: 'admin' | |
| 19 | }, | |
| 20 | validate: { | |
| 21 | query: { | |
| 22 | username: Joi.string().allow(''), | |
| 23 | fields: Joi.string(), | |
| 24 | sort: Joi.string().default('_id'), | |
| 25 | limit: Joi.number().default(20), | |
| 26 | page: Joi.number().default(1) | |
| 27 | } | |
| 28 | }, | |
| 29 | pre: [ | |
| 30 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 31 | ] | |
| 32 | }, | |
| 33 | handler: function (request, reply) { | |
| 34 | ||
| 35 | 3 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 36 | 3 | var query = {}; |
| 37 | 3 | if (request.query.username) { |
| 38 | 1 | query['user.name'] = new RegExp('^.*?' + request.query.username + '.*$', 'i'); |
| 39 | } | |
| 40 | 3 | var fields = request.query.fields; |
| 41 | 3 | var sort = request.query.sort; |
| 42 | 3 | var limit = request.query.limit; |
| 43 | 3 | var page = request.query.page; |
| 44 | ||
| 45 | 3 | Admin.pagedFind(query, fields, sort, limit, page, function (err, results) { |
| 46 | ||
| 47 | 3 | if (err) { |
| 48 | 1 | return reply(err); |
| 49 | } | |
| 50 | ||
| 51 | 2 | reply(results); |
| 52 | }); | |
| 53 | } | |
| 54 | }); | |
| 55 | ||
| 56 | ||
| 57 | 2 | server.route({ |
| 58 | method: 'GET', | |
| 59 | path: options.basePath + '/admins/{id}', | |
| 60 | config: { | |
| 61 | auth: { | |
| 62 | strategy: 'session', | |
| 63 | scope: 'admin' | |
| 64 | }, | |
| 65 | pre: [ | |
| 66 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 67 | ] | |
| 68 | }, | |
| 69 | handler: function (request, reply) { | |
| 70 | ||
| 71 | 3 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 72 | ||
| 73 | 3 | Admin.findById(request.params.id, function (err, admin) { |
| 74 | ||
| 75 | 3 | if (err) { |
| 76 | 1 | return reply(err); |
| 77 | } | |
| 78 | ||
| 79 | 2 | if (!admin) { |
| 80 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 81 | } | |
| 82 | ||
| 83 | 1 | reply(admin); |
| 84 | }); | |
| 85 | } | |
| 86 | }); | |
| 87 | ||
| 88 | ||
| 89 | 2 | server.route({ |
| 90 | method: 'POST', | |
| 91 | path: options.basePath + '/admins', | |
| 92 | config: { | |
| 93 | auth: { | |
| 94 | strategy: 'session', | |
| 95 | scope: 'admin' | |
| 96 | }, | |
| 97 | validate: { | |
| 98 | payload: { | |
| 99 | name: Joi.string().required() | |
| 100 | } | |
| 101 | }, | |
| 102 | pre: [ | |
| 103 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 104 | ] | |
| 105 | }, | |
| 106 | handler: function (request, reply) { | |
| 107 | ||
| 108 | 2 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 109 | 2 | var name = request.payload.name; |
| 110 | ||
| 111 | 2 | Admin.create(name, function (err, admin) { |
| 112 | ||
| 113 | 2 | if (err) { |
| 114 | 1 | return reply(err); |
| 115 | } | |
| 116 | ||
| 117 | 1 | reply(admin); |
| 118 | }); | |
| 119 | } | |
| 120 | }); | |
| 121 | ||
| 122 | ||
| 123 | 2 | server.route({ |
| 124 | method: 'PUT', | |
| 125 | path: options.basePath + '/admins/{id}', | |
| 126 | config: { | |
| 127 | auth: { | |
| 128 | strategy: 'session', | |
| 129 | scope: 'admin' | |
| 130 | }, | |
| 131 | validate: { | |
| 132 | payload: { | |
| 133 | nameFirst: Joi.string().required(), | |
| 134 | nameMiddle: Joi.string().allow(['', null]), | |
| 135 | nameLast: Joi.string().required() | |
| 136 | } | |
| 137 | }, | |
| 138 | pre: [ | |
| 139 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 140 | ] | |
| 141 | }, | |
| 142 | handler: function (request, reply) { | |
| 143 | ||
| 144 | 3 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 145 | 3 | var id = request.params.id; |
| 146 | 3 | var update = { |
| 147 | $set: { | |
| 148 | name: { | |
| 149 | first: request.payload.nameFirst, | |
| 150 | middle: request.payload.nameMiddle, | |
| 151 | last: request.payload.nameLast | |
| 152 | } | |
| 153 | } | |
| 154 | }; | |
| 155 | ||
| 156 | 3 | Admin.findByIdAndUpdate(id, update, function (err, admin) { |
| 157 | ||
| 158 | 3 | if (err) { |
| 159 | 1 | return reply(err); |
| 160 | } | |
| 161 | ||
| 162 | 2 | if (!admin) { |
| 163 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 164 | } | |
| 165 | ||
| 166 | 1 | reply(admin); |
| 167 | }); | |
| 168 | } | |
| 169 | }); | |
| 170 | ||
| 171 | ||
| 172 | 2 | server.route({ |
| 173 | method: 'PUT', | |
| 174 | path: options.basePath + '/admins/{id}/permissions', | |
| 175 | config: { | |
| 176 | auth: { | |
| 177 | strategy: 'session', | |
| 178 | scope: 'admin' | |
| 179 | }, | |
| 180 | validate: { | |
| 181 | payload: { | |
| 182 | permissions: Joi.object().required() | |
| 183 | } | |
| 184 | }, | |
| 185 | pre: [ | |
| 186 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 187 | ] | |
| 188 | }, | |
| 189 | handler: function (request, reply) { | |
| 190 | ||
| 191 | 2 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 192 | 2 | var id = request.params.id; |
| 193 | 2 | var update = { |
| 194 | $set: { | |
| 195 | permissions: request.payload.permissions | |
| 196 | } | |
| 197 | }; | |
| 198 | ||
| 199 | 2 | Admin.findByIdAndUpdate(id, update, function (err, admin) { |
| 200 | ||
| 201 | 2 | if (err) { |
| 202 | 1 | return reply(err); |
| 203 | } | |
| 204 | ||
| 205 | 1 | reply(admin); |
| 206 | }); | |
| 207 | } | |
| 208 | }); | |
| 209 | ||
| 210 | ||
| 211 | 2 | server.route({ |
| 212 | method: 'PUT', | |
| 213 | path: options.basePath + '/admins/{id}/groups', | |
| 214 | config: { | |
| 215 | auth: { | |
| 216 | strategy: 'session', | |
| 217 | scope: 'admin' | |
| 218 | }, | |
| 219 | validate: { | |
| 220 | payload: { | |
| 221 | groups: Joi.object().required() | |
| 222 | } | |
| 223 | }, | |
| 224 | pre: [ | |
| 225 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 226 | ] | |
| 227 | }, | |
| 228 | handler: function (request, reply) { | |
| 229 | ||
| 230 | 2 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 231 | 2 | var id = request.params.id; |
| 232 | 2 | var update = { |
| 233 | $set: { | |
| 234 | groups: request.payload.groups | |
| 235 | } | |
| 236 | }; | |
| 237 | ||
| 238 | 2 | Admin.findByIdAndUpdate(id, update, function (err, admin) { |
| 239 | ||
| 240 | 2 | if (err) { |
| 241 | 1 | return reply(err); |
| 242 | } | |
| 243 | ||
| 244 | 1 | reply(admin); |
| 245 | }); | |
| 246 | } | |
| 247 | }); | |
| 248 | ||
| 249 | ||
| 250 | 2 | server.route({ |
| 251 | method: 'PUT', | |
| 252 | path: options.basePath + '/admins/{id}/user', | |
| 253 | config: { | |
| 254 | auth: { | |
| 255 | strategy: 'session', | |
| 256 | scope: 'admin' | |
| 257 | }, | |
| 258 | validate: { | |
| 259 | payload: { | |
| 260 | username: Joi.string().lowercase().required() | |
| 261 | } | |
| 262 | }, | |
| 263 | pre: [ | |
| 264 | AuthPlugin.preware.ensureAdminGroup('root'), | |
| 265 | { | |
| 266 | assign: 'admin', | |
| 267 | method: function (request, reply) { | |
| 268 | ||
| 269 | 8 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 270 | ||
| 271 | 8 | Admin.findById(request.params.id, function (err, admin) { |
| 272 | ||
| 273 | 8 | if (err) { |
| 274 | 1 | return reply(err); |
| 275 | } | |
| 276 | ||
| 277 | 7 | if (!admin) { |
| 278 | 1 | return reply({ message: 'Document not found.' }).takeover().code(404); |
| 279 | } | |
| 280 | ||
| 281 | 6 | reply(admin); |
| 282 | }); | |
| 283 | } | |
| 284 | }, { | |
| 285 | assign: 'user', | |
| 286 | method: function (request, reply) { | |
| 287 | ||
| 288 | 6 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 289 | ||
| 290 | 6 | User.findByUsername(request.payload.username, function (err, user) { |
| 291 | ||
| 292 | 6 | if (err) { |
| 293 | 1 | return reply(err); |
| 294 | } | |
| 295 | ||
| 296 | 5 | if (!user) { |
| 297 | 1 | return reply({ message: 'User document not found.' }).takeover().code(404); |
| 298 | } | |
| 299 | ||
| 300 | 4 | if (user.roles && |
| 301 | user.roles.admin && | |
| 302 | user.roles.admin.id !== request.params.id) { | |
| 303 | ||
| 304 | 1 | var response = { |
| 305 | message: 'User is already linked to another admin. Unlink first.' | |
| 306 | }; | |
| 307 | ||
| 308 | 1 | return reply(response).takeover().code(409); |
| 309 | } | |
| 310 | ||
| 311 | 3 | reply(user); |
| 312 | }); | |
| 313 | } | |
| 314 | }, { | |
| 315 | assign: 'userCheck', | |
| 316 | method: function (request, reply) { | |
| 317 | ||
| 318 | 3 | if (request.pre.admin.user && |
| 319 | request.pre.admin.user.id !== request.pre.user._id.toString()) { | |
| 320 | ||
| 321 | 1 | var response = { |
| 322 | message: 'Admin is already linked to another user. Unlink first.' | |
| 323 | }; | |
| 324 | ||
| 325 | 1 | return reply(response).takeover().code(409); |
| 326 | } | |
| 327 | ||
| 328 | 2 | reply(true); |
| 329 | } | |
| 330 | } | |
| 331 | ] | |
| 332 | }, | |
| 333 | handler: function (request, reply) { | |
| 334 | ||
| 335 | 2 | Async.auto({ |
| 336 | admin: function (done) { | |
| 337 | ||
| 338 | 2 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 339 | 2 | var id = request.params.id; |
| 340 | 2 | var update = { |
| 341 | $set: { | |
| 342 | user: { | |
| 343 | id: request.pre.user._id.toString(), | |
| 344 | name: request.pre.user.username | |
| 345 | } | |
| 346 | } | |
| 347 | }; | |
| 348 | ||
| 349 | 2 | Admin.findByIdAndUpdate(id, update, done); |
| 350 | }, | |
| 351 | user: function (done) { | |
| 352 | ||
| 353 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 354 | 2 | var id = request.pre.user._id; |
| 355 | 2 | var update = { |
| 356 | $set: { | |
| 357 | 'roles.admin': { | |
| 358 | id: request.pre.admin._id.toString(), | |
| 359 | name: request.pre.admin.name.first + ' ' + request.pre.admin.name.last | |
| 360 | } | |
| 361 | } | |
| 362 | }; | |
| 363 | ||
| 364 | 2 | User.findByIdAndUpdate(id, update, done); |
| 365 | } | |
| 366 | }, function (err, results) { | |
| 367 | ||
| 368 | 2 | if (err) { |
| 369 | 1 | return reply(err); |
| 370 | } | |
| 371 | ||
| 372 | 1 | reply(results.admin); |
| 373 | }); | |
| 374 | } | |
| 375 | }); | |
| 376 | ||
| 377 | ||
| 378 | 2 | server.route({ |
| 379 | method: 'DELETE', | |
| 380 | path: options.basePath + '/admins/{id}/user', | |
| 381 | config: { | |
| 382 | auth: { | |
| 383 | strategy: 'session', | |
| 384 | scope: 'admin' | |
| 385 | }, | |
| 386 | pre: [ | |
| 387 | AuthPlugin.preware.ensureAdminGroup('root'), | |
| 388 | { | |
| 389 | assign: 'admin', | |
| 390 | method: function (request, reply) { | |
| 391 | ||
| 392 | 8 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 393 | ||
| 394 | 8 | Admin.findById(request.params.id, function (err, admin) { |
| 395 | ||
| 396 | 8 | if (err) { |
| 397 | 1 | return reply(err); |
| 398 | } | |
| 399 | ||
| 400 | 7 | if (!admin) { |
| 401 | 1 | return reply({ message: 'Document not found.' }).takeover().code(404); |
| 402 | } | |
| 403 | ||
| 404 | 6 | if (!admin.user || !admin.user.id) { |
| 405 | 2 | return reply(admin).takeover(); |
| 406 | } | |
| 407 | ||
| 408 | 4 | reply(admin); |
| 409 | }); | |
| 410 | } | |
| 411 | }, { | |
| 412 | assign: 'user', | |
| 413 | method: function (request, reply) { | |
| 414 | ||
| 415 | 4 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 416 | ||
| 417 | 4 | User.findById(request.pre.admin.user.id, function (err, user) { |
| 418 | ||
| 419 | 4 | if (err) { |
| 420 | 1 | return reply(err); |
| 421 | } | |
| 422 | ||
| 423 | 3 | if (!user) { |
| 424 | 1 | return reply({ message: 'User document not found.' }).takeover().code(404); |
| 425 | } | |
| 426 | ||
| 427 | 2 | reply(user); |
| 428 | }); | |
| 429 | } | |
| 430 | } | |
| 431 | ] | |
| 432 | }, | |
| 433 | handler: function (request, reply) { | |
| 434 | ||
| 435 | 2 | Async.auto({ |
| 436 | admin: function (done) { | |
| 437 | ||
| 438 | 2 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 439 | 2 | var id = request.params.id; |
| 440 | 2 | var update = { |
| 441 | $unset: { | |
| 442 | user: undefined | |
| 443 | } | |
| 444 | }; | |
| 445 | ||
| 446 | 2 | Admin.findByIdAndUpdate(id, update, done); |
| 447 | }, | |
| 448 | user: function (done) { | |
| 449 | ||
| 450 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 451 | 2 | var id = request.pre.user._id.toString(); |
| 452 | 2 | var update = { |
| 453 | $unset: { | |
| 454 | 'roles.admin': undefined | |
| 455 | } | |
| 456 | }; | |
| 457 | ||
| 458 | 2 | User.findByIdAndUpdate(id, update, done); |
| 459 | } | |
| 460 | }, function (err, results) { | |
| 461 | ||
| 462 | 2 | if (err) { |
| 463 | 1 | return reply(err); |
| 464 | } | |
| 465 | ||
| 466 | 1 | reply(results.admin); |
| 467 | }); | |
| 468 | } | |
| 469 | }); | |
| 470 | ||
| 471 | ||
| 472 | 2 | server.route({ |
| 473 | method: 'DELETE', | |
| 474 | path: options.basePath + '/admins/{id}', | |
| 475 | config: { | |
| 476 | auth: { | |
| 477 | strategy: 'session', | |
| 478 | scope: 'admin' | |
| 479 | }, | |
| 480 | pre: [ | |
| 481 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 482 | ] | |
| 483 | }, | |
| 484 | handler: function (request, reply) { | |
| 485 | ||
| 486 | 3 | var Admin = request.server.plugins['hapi-mongo-models'].Admin; |
| 487 | ||
| 488 | 3 | Admin.findByIdAndDelete(request.params.id, function (err, admin) { |
| 489 | ||
| 490 | 3 | if (err) { |
| 491 | 1 | return reply(err); |
| 492 | } | |
| 493 | ||
| 494 | 2 | if (!admin) { |
| 495 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 496 | } | |
| 497 | ||
| 498 | 1 | reply({ message: 'Success.' }); |
| 499 | }); | |
| 500 | } | |
| 501 | }); | |
| 502 | ||
| 503 | ||
| 504 | 2 | next(); |
| 505 | }; | |
| 506 | ||
| 507 | ||
| 508 | 1 | exports.register.attributes = { |
| 509 | name: 'admins' | |
| 510 | }; | |
| 511 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var AuthPlugin = require('../auth'); |
| 4 | ||
| 5 | ||
| 6 | 1 | exports.register = function (server, options, next) { |
| 7 | ||
| 8 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 9 | ||
| 10 | ||
| 11 | 2 | server.route({ |
| 12 | method: 'GET', | |
| 13 | path: options.basePath + '/auth-attempts', | |
| 14 | config: { | |
| 15 | auth: { | |
| 16 | strategy: 'session', | |
| 17 | scope: 'admin' | |
| 18 | }, | |
| 19 | validate: { | |
| 20 | query: { | |
| 21 | fields: Joi.string(), | |
| 22 | sort: Joi.string().default('_id'), | |
| 23 | limit: Joi.number().default(20), | |
| 24 | page: Joi.number().default(1) | |
| 25 | } | |
| 26 | }, | |
| 27 | pre: [ | |
| 28 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 29 | ] | |
| 30 | }, | |
| 31 | handler: function (request, reply) { | |
| 32 | ||
| 33 | 2 | var AuthAttempt = request.server.plugins['hapi-mongo-models'].AuthAttempt; |
| 34 | 2 | var query = {}; |
| 35 | 2 | var fields = request.query.fields; |
| 36 | 2 | var sort = request.query.sort; |
| 37 | 2 | var limit = request.query.limit; |
| 38 | 2 | var page = request.query.page; |
| 39 | ||
| 40 | 2 | AuthAttempt.pagedFind(query, fields, sort, limit, page, function (err, results) { |
| 41 | ||
| 42 | 2 | if (err) { |
| 43 | 1 | return reply(err); |
| 44 | } | |
| 45 | ||
| 46 | 1 | reply(results); |
| 47 | }); | |
| 48 | } | |
| 49 | }); | |
| 50 | ||
| 51 | ||
| 52 | 2 | server.route({ |
| 53 | method: 'GET', | |
| 54 | path: options.basePath + '/auth-attempts/{id}', | |
| 55 | config: { | |
| 56 | auth: { | |
| 57 | strategy: 'session', | |
| 58 | scope: 'admin' | |
| 59 | }, | |
| 60 | pre: [ | |
| 61 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 62 | ] | |
| 63 | }, | |
| 64 | handler: function (request, reply) { | |
| 65 | ||
| 66 | 3 | var AuthAttempt = request.server.plugins['hapi-mongo-models'].AuthAttempt; |
| 67 | ||
| 68 | 3 | AuthAttempt.findById(request.params.id, function (err, authAttempt) { |
| 69 | ||
| 70 | 3 | if (err) { |
| 71 | 1 | return reply(err); |
| 72 | } | |
| 73 | ||
| 74 | 2 | if (!authAttempt) { |
| 75 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 76 | } | |
| 77 | ||
| 78 | 1 | reply(authAttempt); |
| 79 | }); | |
| 80 | } | |
| 81 | }); | |
| 82 | ||
| 83 | ||
| 84 | 2 | server.route({ |
| 85 | method: 'DELETE', | |
| 86 | path: options.basePath + '/auth-attempts/{id}', | |
| 87 | config: { | |
| 88 | auth: { | |
| 89 | strategy: 'session', | |
| 90 | scope: 'admin' | |
| 91 | }, | |
| 92 | pre: [ | |
| 93 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 94 | ] | |
| 95 | }, | |
| 96 | handler: function (request, reply) { | |
| 97 | ||
| 98 | 3 | var AuthAttempt = request.server.plugins['hapi-mongo-models'].AuthAttempt; |
| 99 | ||
| 100 | 3 | AuthAttempt.findByIdAndDelete(request.params.id, function (err, authAttempt) { |
| 101 | ||
| 102 | 3 | if (err) { |
| 103 | 1 | return reply(err); |
| 104 | } | |
| 105 | ||
| 106 | 2 | if (!authAttempt) { |
| 107 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 108 | } | |
| 109 | ||
| 110 | 1 | reply({ message: 'Success.' }); |
| 111 | }); | |
| 112 | } | |
| 113 | }); | |
| 114 | ||
| 115 | ||
| 116 | 2 | next(); |
| 117 | }; | |
| 118 | ||
| 119 | ||
| 120 | 1 | exports.register.attributes = { |
| 121 | name: 'auth-attempts' | |
| 122 | }; | |
| 123 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var Config = require('../../config'); |
| 4 | ||
| 5 | ||
| 6 | 1 | exports.register = function (server, options, next) { |
| 7 | ||
| 8 | 3 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 9 | ||
| 10 | ||
| 11 | 3 | server.route({ |
| 12 | method: 'POST', | |
| 13 | path: options.basePath + '/contact', | |
| 14 | config: { | |
| 15 | validate: { | |
| 16 | payload: { | |
| 17 | name: Joi.string().required(), | |
| 18 | email: Joi.string().email().required(), | |
| 19 | message: Joi.string().required() | |
| 20 | } | |
| 21 | } | |
| 22 | }, | |
| 23 | handler: function (request, reply) { | |
| 24 | ||
| 25 | 2 | var mailer = request.server.plugins.mailer; |
| 26 | 2 | var emailOptions = { |
| 27 | subject: Config.get('/projectName') + ' contact form', | |
| 28 | to: Config.get('/system/toAddress'), | |
| 29 | replyTo: { | |
| 30 | name: request.payload.name, | |
| 31 | address: request.payload.email | |
| 32 | } | |
| 33 | }; | |
| 34 | 2 | var template = 'contact'; |
| 35 | ||
| 36 | 2 | mailer.sendEmail(emailOptions, template, request.payload, function (err, info) { |
| 37 | ||
| 38 | 2 | if (err) { |
| 39 | 1 | return reply(err); |
| 40 | } | |
| 41 | ||
| 42 | 1 | reply({ message: 'Success.' }); |
| 43 | }); | |
| 44 | } | |
| 45 | }); | |
| 46 | ||
| 47 | ||
| 48 | 3 | next(); |
| 49 | }; | |
| 50 | ||
| 51 | ||
| 52 | 1 | exports.register.attributes = { |
| 53 | name: 'contact' | |
| 54 | }; | |
| 55 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Hoek = require('hoek'); |
| 2 | ||
| 3 | ||
| 4 | 1 | exports.register = function (server, options, next) { |
| 5 | ||
| 6 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 7 | ||
| 8 | ||
| 9 | 2 | server.route({ |
| 10 | method: 'GET', | |
| 11 | path: options.basePath + '/', | |
| 12 | handler: function (request, reply) { | |
| 13 | ||
| 14 | 1 | reply({ message: 'Welcome to the plot device.' }); |
| 15 | } | |
| 16 | }); | |
| 17 | ||
| 18 | ||
| 19 | 2 | next(); |
| 20 | }; | |
| 21 | ||
| 22 | ||
| 23 | 1 | exports.register.attributes = { |
| 24 | name: 'home' | |
| 25 | }; | |
| 26 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var Async = require('async'); |
| 4 | 1 | var Bcrypt = require('bcrypt'); |
| 5 | 1 | var Config = require('../../config'); |
| 6 | ||
| 7 | ||
| 8 | 1 | exports.register = function (server, options, next) { |
| 9 | ||
| 10 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 11 | ||
| 12 | ||
| 13 | 2 | server.route({ |
| 14 | method: 'POST', | |
| 15 | path: options.basePath + '/login', | |
| 16 | config: { | |
| 17 | validate: { | |
| 18 | payload: { | |
| 19 | username: Joi.string().lowercase().required(), | |
| 20 | password: Joi.string().required() | |
| 21 | } | |
| 22 | }, | |
| 23 | plugins: { | |
| 24 | 'hapi-auth-cookie': { | |
| 25 | redirectTo: false | |
| 26 | } | |
| 27 | }, | |
| 28 | auth: { | |
| 29 | mode: 'try', | |
| 30 | strategy: 'session' | |
| 31 | }, | |
| 32 | pre: [{ | |
| 33 | assign: 'abuseDetected', | |
| 34 | method: function (request, reply) { | |
| 35 | ||
| 36 | 7 | var AuthAttempt = request.server.plugins['hapi-mongo-models'].AuthAttempt; |
| 37 | 7 | var ip = request.info.remoteAddress; |
| 38 | 7 | var username = request.payload.username; |
| 39 | ||
| 40 | 7 | AuthAttempt.abuseDetected(ip, username, function (err, detected) { |
| 41 | ||
| 42 | 7 | if (err) { |
| 43 | 1 | return reply(err); |
| 44 | } | |
| 45 | ||
| 46 | 6 | if (detected) { |
| 47 | 1 | return reply({ |
| 48 | message: 'Maximum number of auth attempts reached. Please try again later.' | |
| 49 | }).takeover().code(400); | |
| 50 | } | |
| 51 | ||
| 52 | 5 | reply(); |
| 53 | }); | |
| 54 | } | |
| 55 | }, { | |
| 56 | assign: 'user', | |
| 57 | method: function (request, reply) { | |
| 58 | ||
| 59 | 5 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 60 | 5 | var username = request.payload.username; |
| 61 | 5 | var password = request.payload.password; |
| 62 | ||
| 63 | 5 | User.findByCredentials(username, password, function (err, user) { |
| 64 | ||
| 65 | 5 | if (err) { |
| 66 | 1 | return reply(err); |
| 67 | } | |
| 68 | ||
| 69 | 4 | reply(user); |
| 70 | }); | |
| 71 | } | |
| 72 | }, { | |
| 73 | assign: 'logAttempt', | |
| 74 | method: function (request, reply) { | |
| 75 | ||
| 76 | 4 | if (request.pre.user) { |
| 77 | 2 | return reply(); |
| 78 | } | |
| 79 | ||
| 80 | 2 | var AuthAttempt = request.server.plugins['hapi-mongo-models'].AuthAttempt; |
| 81 | 2 | var ip = request.info.remoteAddress; |
| 82 | 2 | var username = request.payload.username; |
| 83 | ||
| 84 | 2 | AuthAttempt.create(ip, username, function (err, authAttempt) { |
| 85 | ||
| 86 | 2 | if (err) { |
| 87 | 1 | return reply(err); |
| 88 | } | |
| 89 | ||
| 90 | 1 | return reply({ |
| 91 | message: 'Username and password combination not found or account is inactive.' | |
| 92 | }).takeover().code(400); | |
| 93 | }); | |
| 94 | } | |
| 95 | }, { | |
| 96 | assign: 'session', | |
| 97 | method: function (request, reply) { | |
| 98 | ||
| 99 | 2 | var Session = request.server.plugins['hapi-mongo-models'].Session; |
| 100 | ||
| 101 | 2 | Session.create(request.pre.user._id.toString(), function (err, session) { |
| 102 | ||
| 103 | 2 | if (err) { |
| 104 | 1 | return reply(err); |
| 105 | } | |
| 106 | ||
| 107 | 1 | return reply(session); |
| 108 | }); | |
| 109 | } | |
| 110 | }] | |
| 111 | }, | |
| 112 | handler: function (request, reply) { | |
| 113 | ||
| 114 | 1 | var credentials = request.pre.session._id.toString() + ':' + request.pre.session.key; |
| 115 | 1 | var authHeader = 'Basic ' + new Buffer(credentials).toString('base64'); |
| 116 | ||
| 117 | 1 | var result = { |
| 118 | user: { | |
| 119 | _id: request.pre.user._id, | |
| 120 | username: request.pre.user.username, | |
| 121 | email: request.pre.user.email, | |
| 122 | roles: request.pre.user.roles | |
| 123 | }, | |
| 124 | session: request.pre.session, | |
| 125 | authHeader: authHeader | |
| 126 | }; | |
| 127 | ||
| 128 | 1 | request.auth.session.set(result); |
| 129 | 1 | reply(result); |
| 130 | } | |
| 131 | }); | |
| 132 | ||
| 133 | ||
| 134 | 2 | server.route({ |
| 135 | method: 'POST', | |
| 136 | path: options.basePath + '/login/forgot', | |
| 137 | config: { | |
| 138 | validate: { | |
| 139 | payload: { | |
| 140 | email: Joi.string().email().lowercase().required() | |
| 141 | } | |
| 142 | }, | |
| 143 | pre: [{ | |
| 144 | assign: 'user', | |
| 145 | method: function (request, reply) { | |
| 146 | ||
| 147 | 4 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 148 | 4 | var conditions = { |
| 149 | email: request.payload.email | |
| 150 | }; | |
| 151 | ||
| 152 | 4 | User.findOne(conditions, function (err, user) { |
| 153 | ||
| 154 | 4 | if (err) { |
| 155 | 1 | return reply(err); |
| 156 | } | |
| 157 | ||
| 158 | 3 | if (!user) { |
| 159 | 1 | return reply({ message: 'Success.' }).takeover(); |
| 160 | } | |
| 161 | ||
| 162 | 2 | reply(user); |
| 163 | }); | |
| 164 | } | |
| 165 | }] | |
| 166 | }, | |
| 167 | handler: function (request, reply) { | |
| 168 | ||
| 169 | 2 | var Session = request.server.plugins['hapi-mongo-models'].Session; |
| 170 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 171 | 2 | var mailer = request.server.plugins.mailer; |
| 172 | ||
| 173 | 2 | Async.auto({ |
| 174 | keyHash: function (done) { | |
| 175 | ||
| 176 | 2 | Session.generateKeyHash(done); |
| 177 | }, | |
| 178 | user: ['keyHash', function (done, results) { | |
| 179 | ||
| 180 | 2 | var id = request.pre.user._id.toString(); |
| 181 | 2 | var update = { |
| 182 | $set: { | |
| 183 | resetPassword: { | |
| 184 | token: results.keyHash.hash, | |
| 185 | expires: Date.now() + 10000000 | |
| 186 | } | |
| 187 | } | |
| 188 | }; | |
| 189 | ||
| 190 | 2 | User.findByIdAndUpdate(id, update, done); |
| 191 | }], | |
| 192 | email: ['user', function (done, results) { | |
| 193 | ||
| 194 | 1 | var emailOptions = { |
| 195 | subject: 'Reset your ' + Config.get('/projectName') + ' password', | |
| 196 | to: request.payload.email | |
| 197 | }; | |
| 198 | 1 | var template = 'forgot-password'; |
| 199 | 1 | var context = { |
| 200 | baseHref: Config.get('/baseUrl') + '/login/reset', | |
| 201 | email: request.payload.email, | |
| 202 | key: results.keyHash.key | |
| 203 | }; | |
| 204 | ||
| 205 | 1 | mailer.sendEmail(emailOptions, template, context, done); |
| 206 | }] | |
| 207 | }, function (err, results) { | |
| 208 | ||
| 209 | 2 | if (err) { |
| 210 | 1 | return reply(err); |
| 211 | } | |
| 212 | ||
| 213 | 1 | reply({ message: 'Success.' }); |
| 214 | }); | |
| 215 | } | |
| 216 | }); | |
| 217 | ||
| 218 | ||
| 219 | 2 | server.route({ |
| 220 | method: 'POST', | |
| 221 | path: options.basePath + '/login/reset', | |
| 222 | config: { | |
| 223 | validate: { | |
| 224 | payload: { | |
| 225 | key: Joi.string().required(), | |
| 226 | email: Joi.string().email().lowercase().required(), | |
| 227 | password: Joi.string().required() | |
| 228 | } | |
| 229 | }, | |
| 230 | pre: [{ | |
| 231 | assign: 'user', | |
| 232 | method: function (request, reply) { | |
| 233 | ||
| 234 | 5 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 235 | 5 | var conditions = { |
| 236 | email: request.payload.email, | |
| 237 | 'resetPassword.expires': { $gt: Date.now() } | |
| 238 | }; | |
| 239 | ||
| 240 | 5 | User.findOne(conditions, function (err, user) { |
| 241 | ||
| 242 | 5 | if (err) { |
| 243 | 1 | return reply(err); |
| 244 | } | |
| 245 | ||
| 246 | 4 | if (!user) { |
| 247 | 1 | return reply({ message: 'Invalid email or key.' }).takeover().code(400); |
| 248 | } | |
| 249 | ||
| 250 | 3 | reply(user); |
| 251 | }); | |
| 252 | } | |
| 253 | }] | |
| 254 | }, | |
| 255 | handler: function (request, reply) { | |
| 256 | ||
| 257 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 258 | ||
| 259 | 3 | Async.auto({ |
| 260 | keyMatch: function (done) { | |
| 261 | ||
| 262 | 3 | var key = request.payload.key; |
| 263 | 3 | var token = request.pre.user.resetPassword.token; |
| 264 | 3 | Bcrypt.compare(key, token, done); |
| 265 | }, | |
| 266 | passwordHash: ['keyMatch', function (done, results) { | |
| 267 | ||
| 268 | 2 | if (!results.keyMatch) { |
| 269 | 1 | return reply({ message: 'Invalid email or key.' }).takeover().code(400); |
| 270 | } | |
| 271 | ||
| 272 | 1 | User.generatePasswordHash(request.payload.password, done); |
| 273 | }], | |
| 274 | user: ['passwordHash', function (done, results) { | |
| 275 | ||
| 276 | 1 | var id = request.pre.user._id.toString(); |
| 277 | 1 | var update = { |
| 278 | $set: { | |
| 279 | password: results.passwordHash.hash | |
| 280 | }, | |
| 281 | $unset: { | |
| 282 | resetPassword: undefined | |
| 283 | } | |
| 284 | }; | |
| 285 | ||
| 286 | 1 | User.findByIdAndUpdate(id, update, done); |
| 287 | }] | |
| 288 | }, function (err, results) { | |
| 289 | ||
| 290 | 2 | if (err) { |
| 291 | 1 | return reply(err); |
| 292 | } | |
| 293 | ||
| 294 | 1 | reply({ message: 'Success.' }); |
| 295 | }); | |
| 296 | } | |
| 297 | }); | |
| 298 | ||
| 299 | ||
| 300 | 2 | next(); |
| 301 | }; | |
| 302 | ||
| 303 | ||
| 304 | 1 | exports.register.attributes = { |
| 305 | name: 'login' | |
| 306 | }; | |
| 307 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Hoek = require('hoek'); |
| 2 | ||
| 3 | ||
| 4 | 1 | exports.register = function (server, options, next) { |
| 5 | ||
| 6 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 7 | ||
| 8 | ||
| 9 | 2 | server.route({ |
| 10 | method: 'DELETE', | |
| 11 | path: options.basePath + '/logout', | |
| 12 | config: { | |
| 13 | auth: { | |
| 14 | mode: 'try', | |
| 15 | strategy: 'session' | |
| 16 | }, | |
| 17 | plugins: { | |
| 18 | 'hapi-auth-cookie': { | |
| 19 | redirectTo: false | |
| 20 | } | |
| 21 | } | |
| 22 | }, | |
| 23 | handler: function (request, reply) { | |
| 24 | ||
| 25 | 4 | var Session = request.server.plugins['hapi-mongo-models'].Session; |
| 26 | 4 | var credentials = request.auth.credentials || { session: {} }; |
| 27 | 4 | var session = credentials.session || {}; |
| 28 | ||
| 29 | 4 | Session.findByIdAndDelete(session._id, function (err, sessionDoc) { |
| 30 | ||
| 31 | 4 | if (err) { |
| 32 | 1 | return reply(err); |
| 33 | } | |
| 34 | ||
| 35 | 3 | if (!sessionDoc) { |
| 36 | 2 | return reply({ message: 'Session not found.' }).code(404); |
| 37 | } | |
| 38 | ||
| 39 | 1 | request.auth.session.clear(); |
| 40 | 1 | reply({ message: 'Success.' }); |
| 41 | }); | |
| 42 | } | |
| 43 | }); | |
| 44 | ||
| 45 | ||
| 46 | 2 | next(); |
| 47 | }; | |
| 48 | ||
| 49 | ||
| 50 | 1 | exports.register.attributes = { |
| 51 | name: 'logout' | |
| 52 | }; | |
| 53 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var AuthPlugin = require('../auth'); |
| 4 | ||
| 5 | ||
| 6 | 1 | exports.register = function (server, options, next) { |
| 7 | ||
| 8 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 9 | ||
| 10 | ||
| 11 | 2 | server.route({ |
| 12 | method: 'GET', | |
| 13 | path: options.basePath + '/sessions', | |
| 14 | config: { | |
| 15 | auth: { | |
| 16 | strategy: 'session', | |
| 17 | scope: 'admin' | |
| 18 | }, | |
| 19 | validate: { | |
| 20 | query: { | |
| 21 | fields: Joi.string(), | |
| 22 | sort: Joi.string().default('_id'), | |
| 23 | limit: Joi.number().default(20), | |
| 24 | page: Joi.number().default(1) | |
| 25 | } | |
| 26 | }, | |
| 27 | pre: [ | |
| 28 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 29 | ] | |
| 30 | }, | |
| 31 | handler: function (request, reply) { | |
| 32 | ||
| 33 | 2 | var Session = request.server.plugins['hapi-mongo-models'].Session; |
| 34 | 2 | var query = {}; |
| 35 | 2 | var fields = request.query.fields; |
| 36 | 2 | var sort = request.query.sort; |
| 37 | 2 | var limit = request.query.limit; |
| 38 | 2 | var page = request.query.page; |
| 39 | ||
| 40 | 2 | Session.pagedFind(query, fields, sort, limit, page, function (err, results) { |
| 41 | ||
| 42 | 2 | if (err) { |
| 43 | 1 | return reply(err); |
| 44 | } | |
| 45 | ||
| 46 | 1 | reply(results); |
| 47 | }); | |
| 48 | } | |
| 49 | }); | |
| 50 | ||
| 51 | ||
| 52 | 2 | server.route({ |
| 53 | method: 'GET', | |
| 54 | path: options.basePath + '/sessions/{id}', | |
| 55 | config: { | |
| 56 | auth: { | |
| 57 | strategy: 'session', | |
| 58 | scope: 'admin' | |
| 59 | }, | |
| 60 | pre: [ | |
| 61 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 62 | ] | |
| 63 | }, | |
| 64 | handler: function (request, reply) { | |
| 65 | ||
| 66 | 3 | var Session = request.server.plugins['hapi-mongo-models'].Session; |
| 67 | ||
| 68 | 3 | Session.findById(request.params.id, function (err, session) { |
| 69 | ||
| 70 | 3 | if (err) { |
| 71 | 1 | return reply(err); |
| 72 | } | |
| 73 | ||
| 74 | 2 | if (!session) { |
| 75 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 76 | } | |
| 77 | ||
| 78 | 1 | reply(session); |
| 79 | }); | |
| 80 | } | |
| 81 | }); | |
| 82 | ||
| 83 | ||
| 84 | 2 | server.route({ |
| 85 | method: 'DELETE', | |
| 86 | path: options.basePath + '/sessions/{id}', | |
| 87 | config: { | |
| 88 | auth: { | |
| 89 | strategy: 'session', | |
| 90 | scope: 'admin' | |
| 91 | }, | |
| 92 | pre: [ | |
| 93 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 94 | ] | |
| 95 | }, | |
| 96 | handler: function (request, reply) { | |
| 97 | ||
| 98 | 3 | var Session = request.server.plugins['hapi-mongo-models'].Session; |
| 99 | ||
| 100 | 3 | Session.findByIdAndDelete(request.params.id, function (err, session) { |
| 101 | ||
| 102 | 3 | if (err) { |
| 103 | 1 | return reply(err); |
| 104 | } | |
| 105 | ||
| 106 | 2 | if (!session) { |
| 107 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 108 | } | |
| 109 | ||
| 110 | 1 | reply({ message: 'Success.' }); |
| 111 | }); | |
| 112 | } | |
| 113 | }); | |
| 114 | ||
| 115 | ||
| 116 | 2 | next(); |
| 117 | }; | |
| 118 | ||
| 119 | ||
| 120 | 1 | exports.register.attributes = { |
| 121 | name: 'sessions' | |
| 122 | }; | |
| 123 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var Async = require('async'); |
| 4 | 1 | var Config = require('../../config'); |
| 5 | ||
| 6 | ||
| 7 | 1 | exports.register = function (server, options, next) { |
| 8 | ||
| 9 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 10 | ||
| 11 | ||
| 12 | 2 | server.route({ |
| 13 | method: 'POST', | |
| 14 | path: options.basePath + '/signup', | |
| 15 | config: { | |
| 16 | plugins: { | |
| 17 | 'hapi-auth-cookie': { | |
| 18 | redirectTo: false | |
| 19 | } | |
| 20 | }, | |
| 21 | auth: { | |
| 22 | mode: 'try', | |
| 23 | strategy: 'session' | |
| 24 | }, | |
| 25 | validate: { | |
| 26 | payload: { | |
| 27 | name: Joi.string().required(), | |
| 28 | email: Joi.string().email().lowercase().required(), | |
| 29 | username: Joi.string().token().lowercase().required(), | |
| 30 | password: Joi.string().required() | |
| 31 | } | |
| 32 | }, | |
| 33 | pre: [{ | |
| 34 | assign: 'usernameCheck', | |
| 35 | method: function (request, reply) { | |
| 36 | ||
| 37 | 7 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 38 | 7 | var conditions = { |
| 39 | username: request.payload.username | |
| 40 | }; | |
| 41 | ||
| 42 | 7 | User.findOne(conditions, function (err, user) { |
| 43 | ||
| 44 | 7 | if (err) { |
| 45 | 1 | return reply(err); |
| 46 | } | |
| 47 | ||
| 48 | 6 | if (user) { |
| 49 | 1 | var response = { |
| 50 | message: 'Username already in use.' | |
| 51 | }; | |
| 52 | ||
| 53 | 1 | return reply(response).takeover().code(409); |
| 54 | } | |
| 55 | ||
| 56 | 5 | reply(true); |
| 57 | }); | |
| 58 | } | |
| 59 | }, { | |
| 60 | assign: 'emailCheck', | |
| 61 | method: function (request, reply) { | |
| 62 | ||
| 63 | 5 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 64 | 5 | var conditions = { |
| 65 | email: request.payload.email | |
| 66 | }; | |
| 67 | ||
| 68 | 5 | User.findOne(conditions, function (err, user) { |
| 69 | ||
| 70 | 5 | if (err) { |
| 71 | 1 | return reply(err); |
| 72 | } | |
| 73 | ||
| 74 | 4 | if (user) { |
| 75 | 1 | var response = { |
| 76 | message: 'Email already in use.' | |
| 77 | }; | |
| 78 | ||
| 79 | 1 | return reply(response).takeover().code(409); |
| 80 | } | |
| 81 | ||
| 82 | 3 | reply(true); |
| 83 | }); | |
| 84 | } | |
| 85 | }] | |
| 86 | }, | |
| 87 | handler: function (request, reply) { | |
| 88 | ||
| 89 | 3 | var Account = request.server.plugins['hapi-mongo-models'].Account; |
| 90 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 91 | 3 | var Session = request.server.plugins['hapi-mongo-models'].Session; |
| 92 | 3 | var mailer = request.server.plugins.mailer; |
| 93 | ||
| 94 | 3 | Async.auto({ |
| 95 | user: function (done) { | |
| 96 | ||
| 97 | 3 | var username = request.payload.username; |
| 98 | 3 | var password = request.payload.password; |
| 99 | 3 | var email = request.payload.email; |
| 100 | ||
| 101 | 3 | User.create(username, password, email, done); |
| 102 | }, | |
| 103 | account: ['user', function (done, results) { | |
| 104 | ||
| 105 | 2 | var name = request.payload.name; |
| 106 | ||
| 107 | 2 | Account.create(name, done); |
| 108 | }], | |
| 109 | linkUser: ['account', function (done, results) { | |
| 110 | ||
| 111 | 2 | var id = results.account._id.toString(); |
| 112 | 2 | var update = { |
| 113 | $set: { | |
| 114 | user: { | |
| 115 | id: results.user._id.toString(), | |
| 116 | name: results.user.username | |
| 117 | } | |
| 118 | } | |
| 119 | }; | |
| 120 | ||
| 121 | 2 | Account.findByIdAndUpdate(id, update, done); |
| 122 | }], | |
| 123 | linkAccount: ['account', function (done, results) { | |
| 124 | ||
| 125 | 2 | var id = results.user._id.toString(); |
| 126 | 2 | var update = { |
| 127 | $set: { | |
| 128 | roles: { | |
| 129 | account: { | |
| 130 | id: results.account._id.toString(), | |
| 131 | name: results.account.name.first + ' ' + results.account.name.last | |
| 132 | } | |
| 133 | } | |
| 134 | } | |
| 135 | }; | |
| 136 | ||
| 137 | 2 | User.findByIdAndUpdate(id, update, done); |
| 138 | }], | |
| 139 | welcome: ['linkUser', 'linkAccount', function (done, results) { | |
| 140 | ||
| 141 | 2 | var emailOptions = { |
| 142 | subject: 'Your ' + Config.get('/projectName') + ' account', | |
| 143 | to: { | |
| 144 | name: request.payload.name, | |
| 145 | address: request.payload.email | |
| 146 | } | |
| 147 | }; | |
| 148 | 2 | var template = 'welcome'; |
| 149 | ||
| 150 | 2 | mailer.sendEmail(emailOptions, template, request.payload, function (err) { |
| 151 | ||
| 152 | 2 | if (err) { |
| 153 | 1 | console.warn('sending welcome email failed:', err.stack); |
| 154 | } | |
| 155 | }); | |
| 156 | ||
| 157 | 2 | done(); |
| 158 | }], | |
| 159 | session: ['linkUser', 'linkAccount', function (done, results) { | |
| 160 | ||
| 161 | 2 | Session.create(results.user._id.toString(), done); |
| 162 | }] | |
| 163 | }, function (err, results) { | |
| 164 | ||
| 165 | 3 | if (err) { |
| 166 | 1 | return reply(err); |
| 167 | } | |
| 168 | ||
| 169 | 2 | var user = results.linkAccount; |
| 170 | 2 | var credentials = user.username + ':' + results.session.key; |
| 171 | 2 | var authHeader = 'Basic ' + new Buffer(credentials).toString('base64'); |
| 172 | 2 | var result = { |
| 173 | user: { | |
| 174 | _id: user._id, | |
| 175 | username: user.username, | |
| 176 | email: user.email, | |
| 177 | roles: user.roles | |
| 178 | }, | |
| 179 | session: results.session, | |
| 180 | authHeader: authHeader | |
| 181 | }; | |
| 182 | ||
| 183 | 2 | request.auth.session.set(result); |
| 184 | 2 | reply(result); |
| 185 | }); | |
| 186 | } | |
| 187 | }); | |
| 188 | ||
| 189 | ||
| 190 | 2 | next(); |
| 191 | }; | |
| 192 | ||
| 193 | ||
| 194 | 1 | exports.register.attributes = { |
| 195 | name: 'signup' | |
| 196 | }; | |
| 197 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var AuthPlugin = require('../auth'); |
| 4 | ||
| 5 | ||
| 6 | 1 | exports.register = function (server, options, next) { |
| 7 | ||
| 8 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 9 | ||
| 10 | ||
| 11 | 2 | server.route({ |
| 12 | method: 'GET', | |
| 13 | path: options.basePath + '/statuses', | |
| 14 | config: { | |
| 15 | auth: { | |
| 16 | strategy: 'session', | |
| 17 | scope: 'admin' | |
| 18 | }, | |
| 19 | validate: { | |
| 20 | query: { | |
| 21 | name: Joi.string().allow(''), | |
| 22 | pivot: Joi.string().allow(''), | |
| 23 | fields: Joi.string(), | |
| 24 | sort: Joi.string().default('_id'), | |
| 25 | limit: Joi.number().default(20), | |
| 26 | page: Joi.number().default(1) | |
| 27 | } | |
| 28 | }, | |
| 29 | pre: [ | |
| 30 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 31 | ] | |
| 32 | }, | |
| 33 | handler: function (request, reply) { | |
| 34 | ||
| 35 | 3 | var Status = request.server.plugins['hapi-mongo-models'].Status; |
| 36 | 3 | var query = {}; |
| 37 | 3 | if (request.query.pivot) { |
| 38 | 1 | query.pivot = new RegExp('^.*?' + request.query.pivot + '.*$', 'i'); |
| 39 | } | |
| 40 | 3 | if (request.query.name) { |
| 41 | 1 | query.name = new RegExp('^.*?' + request.query.name + '.*$', 'i'); |
| 42 | } | |
| 43 | 3 | var fields = request.query.fields; |
| 44 | 3 | var sort = request.query.sort; |
| 45 | 3 | var limit = request.query.limit; |
| 46 | 3 | var page = request.query.page; |
| 47 | ||
| 48 | 3 | Status.pagedFind(query, fields, sort, limit, page, function (err, results) { |
| 49 | ||
| 50 | 3 | if (err) { |
| 51 | 1 | return reply(err); |
| 52 | } | |
| 53 | ||
| 54 | 2 | reply(results); |
| 55 | }); | |
| 56 | } | |
| 57 | }); | |
| 58 | ||
| 59 | ||
| 60 | 2 | server.route({ |
| 61 | method: 'GET', | |
| 62 | path: options.basePath + '/statuses/{id}', | |
| 63 | config: { | |
| 64 | auth: { | |
| 65 | strategy: 'session', | |
| 66 | scope: 'admin' | |
| 67 | }, | |
| 68 | pre: [ | |
| 69 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 70 | ] | |
| 71 | }, | |
| 72 | handler: function (request, reply) { | |
| 73 | ||
| 74 | 3 | var Status = request.server.plugins['hapi-mongo-models'].Status; |
| 75 | ||
| 76 | 3 | Status.findById(request.params.id, function (err, status) { |
| 77 | ||
| 78 | 3 | if (err) { |
| 79 | 1 | return reply(err); |
| 80 | } | |
| 81 | ||
| 82 | 2 | if (!status) { |
| 83 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 84 | } | |
| 85 | ||
| 86 | 1 | reply(status); |
| 87 | }); | |
| 88 | } | |
| 89 | }); | |
| 90 | ||
| 91 | ||
| 92 | 2 | server.route({ |
| 93 | method: 'POST', | |
| 94 | path: options.basePath + '/statuses', | |
| 95 | config: { | |
| 96 | auth: { | |
| 97 | strategy: 'session', | |
| 98 | scope: 'admin' | |
| 99 | }, | |
| 100 | validate: { | |
| 101 | payload: { | |
| 102 | pivot: Joi.string().required(), | |
| 103 | name: Joi.string().required() | |
| 104 | } | |
| 105 | }, | |
| 106 | pre: [ | |
| 107 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 108 | ] | |
| 109 | }, | |
| 110 | handler: function (request, reply) { | |
| 111 | ||
| 112 | 2 | var Status = request.server.plugins['hapi-mongo-models'].Status; |
| 113 | 2 | var pivot = request.payload.pivot; |
| 114 | 2 | var name = request.payload.name; |
| 115 | ||
| 116 | 2 | Status.create(pivot, name, function (err, status) { |
| 117 | ||
| 118 | 2 | if (err) { |
| 119 | 1 | return reply(err); |
| 120 | } | |
| 121 | ||
| 122 | 1 | reply(status); |
| 123 | }); | |
| 124 | } | |
| 125 | }); | |
| 126 | ||
| 127 | ||
| 128 | 2 | server.route({ |
| 129 | method: 'PUT', | |
| 130 | path: options.basePath + '/statuses/{id}', | |
| 131 | config: { | |
| 132 | auth: { | |
| 133 | strategy: 'session', | |
| 134 | scope: 'admin' | |
| 135 | }, | |
| 136 | validate: { | |
| 137 | payload: { | |
| 138 | name: Joi.string().required() | |
| 139 | } | |
| 140 | }, | |
| 141 | pre: [ | |
| 142 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 143 | ] | |
| 144 | }, | |
| 145 | handler: function (request, reply) { | |
| 146 | ||
| 147 | 3 | var Status = request.server.plugins['hapi-mongo-models'].Status; |
| 148 | 3 | var id = request.params.id; |
| 149 | 3 | var update = { |
| 150 | $set: { | |
| 151 | name: request.payload.name | |
| 152 | } | |
| 153 | }; | |
| 154 | ||
| 155 | 3 | Status.findByIdAndUpdate(id, update, function (err, status) { |
| 156 | ||
| 157 | 3 | if (err) { |
| 158 | 1 | return reply(err); |
| 159 | } | |
| 160 | ||
| 161 | 2 | if (!status) { |
| 162 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 163 | } | |
| 164 | ||
| 165 | 1 | reply(status); |
| 166 | }); | |
| 167 | } | |
| 168 | }); | |
| 169 | ||
| 170 | ||
| 171 | 2 | server.route({ |
| 172 | method: 'DELETE', | |
| 173 | path: options.basePath + '/statuses/{id}', | |
| 174 | config: { | |
| 175 | auth: { | |
| 176 | strategy: 'session', | |
| 177 | scope: 'admin' | |
| 178 | }, | |
| 179 | pre: [ | |
| 180 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 181 | ] | |
| 182 | }, | |
| 183 | handler: function (request, reply) { | |
| 184 | ||
| 185 | 3 | var Status = request.server.plugins['hapi-mongo-models'].Status; |
| 186 | ||
| 187 | 3 | Status.findByIdAndDelete(request.params.id, function (err, status) { |
| 188 | ||
| 189 | 3 | if (err) { |
| 190 | 1 | return reply(err); |
| 191 | } | |
| 192 | ||
| 193 | 2 | if (!status) { |
| 194 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 195 | } | |
| 196 | ||
| 197 | 1 | reply({ message: 'Success.' }); |
| 198 | }); | |
| 199 | } | |
| 200 | }); | |
| 201 | ||
| 202 | ||
| 203 | 2 | next(); |
| 204 | }; | |
| 205 | ||
| 206 | ||
| 207 | 1 | exports.register.attributes = { |
| 208 | name: 'statuses' | |
| 209 | }; | |
| 210 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Hoek = require('hoek'); |
| 3 | 1 | var AuthPlugin = require('../auth'); |
| 4 | ||
| 5 | ||
| 6 | 1 | exports.register = function (server, options, next) { |
| 7 | ||
| 8 | 2 | options = Hoek.applyToDefaults({ basePath: '' }, options); |
| 9 | ||
| 10 | ||
| 11 | 2 | server.route({ |
| 12 | method: 'GET', | |
| 13 | path: options.basePath + '/users', | |
| 14 | config: { | |
| 15 | auth: { | |
| 16 | strategy: 'session', | |
| 17 | scope: 'admin' | |
| 18 | }, | |
| 19 | validate: { | |
| 20 | query: { | |
| 21 | username: Joi.string().token().lowercase().allow(''), | |
| 22 | isActive: Joi.string().allow(''), | |
| 23 | role: Joi.string().allow(''), | |
| 24 | fields: Joi.string(), | |
| 25 | sort: Joi.string().default('_id'), | |
| 26 | limit: Joi.number().default(20), | |
| 27 | page: Joi.number().default(1) | |
| 28 | } | |
| 29 | }, | |
| 30 | pre: [ | |
| 31 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 32 | ] | |
| 33 | }, | |
| 34 | handler: function (request, reply) { | |
| 35 | ||
| 36 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 37 | 3 | var query = {}; |
| 38 | 3 | if (request.query.username) { |
| 39 | 1 | query.username = new RegExp('^.*?' + request.query.username + '.*$', 'i'); |
| 40 | } | |
| 41 | 3 | if (request.query.isActive) { |
| 42 | 1 | query.isActive = request.query.isActive === 'true'; |
| 43 | } | |
| 44 | 3 | if (request.query.role) { |
| 45 | 1 | query['roles.' + request.query.role] = { $exists: true }; |
| 46 | } | |
| 47 | 3 | var fields = request.query.fields; |
| 48 | 3 | var sort = request.query.sort; |
| 49 | 3 | var limit = request.query.limit; |
| 50 | 3 | var page = request.query.page; |
| 51 | ||
| 52 | 3 | User.pagedFind(query, fields, sort, limit, page, function (err, results) { |
| 53 | ||
| 54 | 3 | if (err) { |
| 55 | 1 | return reply(err); |
| 56 | } | |
| 57 | ||
| 58 | 2 | reply(results); |
| 59 | }); | |
| 60 | } | |
| 61 | }); | |
| 62 | ||
| 63 | ||
| 64 | 2 | server.route({ |
| 65 | method: 'GET', | |
| 66 | path: options.basePath + '/users/{id}', | |
| 67 | config: { | |
| 68 | auth: { | |
| 69 | strategy: 'session', | |
| 70 | scope: 'admin' | |
| 71 | }, | |
| 72 | pre: [ | |
| 73 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 74 | ] | |
| 75 | }, | |
| 76 | handler: function (request, reply) { | |
| 77 | ||
| 78 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 79 | ||
| 80 | 3 | User.findById(request.params.id, function (err, user) { |
| 81 | ||
| 82 | 3 | if (err) { |
| 83 | 1 | return reply(err); |
| 84 | } | |
| 85 | ||
| 86 | 2 | if (!user) { |
| 87 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 88 | } | |
| 89 | ||
| 90 | 1 | reply(user); |
| 91 | }); | |
| 92 | } | |
| 93 | }); | |
| 94 | ||
| 95 | ||
| 96 | 2 | server.route({ |
| 97 | method: 'GET', | |
| 98 | path: options.basePath + '/users/my', | |
| 99 | config: { | |
| 100 | auth: { | |
| 101 | strategy: 'session', | |
| 102 | scope: ['admin', 'account'] | |
| 103 | } | |
| 104 | }, | |
| 105 | handler: function (request, reply) { | |
| 106 | ||
| 107 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 108 | 3 | var id = request.auth.credentials.user._id.toString(); |
| 109 | 3 | var fields = User.fieldsAdapter('username email roles'); |
| 110 | ||
| 111 | 3 | User.findById(id, fields, function (err, user) { |
| 112 | ||
| 113 | 3 | if (err) { |
| 114 | 1 | return reply(err); |
| 115 | } | |
| 116 | ||
| 117 | 2 | if (!user) { |
| 118 | 1 | return reply({ message: 'Document not found. That is strange.' }).code(404); |
| 119 | } | |
| 120 | ||
| 121 | 1 | reply(user); |
| 122 | }); | |
| 123 | } | |
| 124 | }); | |
| 125 | ||
| 126 | ||
| 127 | 2 | server.route({ |
| 128 | method: 'POST', | |
| 129 | path: options.basePath + '/users', | |
| 130 | config: { | |
| 131 | auth: { | |
| 132 | strategy: 'session', | |
| 133 | scope: 'admin' | |
| 134 | }, | |
| 135 | validate: { | |
| 136 | payload: { | |
| 137 | username: Joi.string().token().lowercase().required(), | |
| 138 | email: Joi.string().email().lowercase().required(), | |
| 139 | password: Joi.string().required() | |
| 140 | } | |
| 141 | }, | |
| 142 | pre: [ | |
| 143 | AuthPlugin.preware.ensureAdminGroup('root'), | |
| 144 | { | |
| 145 | assign: 'usernameCheck', | |
| 146 | method: function (request, reply) { | |
| 147 | ||
| 148 | 6 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 149 | 6 | var conditions = { |
| 150 | username: request.payload.username | |
| 151 | }; | |
| 152 | ||
| 153 | 6 | User.findOne(conditions, function (err, user) { |
| 154 | ||
| 155 | 6 | if (err) { |
| 156 | 1 | return reply(err); |
| 157 | } | |
| 158 | ||
| 159 | 5 | if (user) { |
| 160 | 1 | var response = { |
| 161 | message: 'Username already in use.' | |
| 162 | }; | |
| 163 | ||
| 164 | 1 | return reply(response).takeover().code(409); |
| 165 | } | |
| 166 | ||
| 167 | 4 | reply(true); |
| 168 | }); | |
| 169 | } | |
| 170 | }, { | |
| 171 | assign: 'emailCheck', | |
| 172 | method: function (request, reply) { | |
| 173 | ||
| 174 | 4 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 175 | 4 | var conditions = { |
| 176 | email: request.payload.email | |
| 177 | }; | |
| 178 | ||
| 179 | 4 | User.findOne(conditions, function (err, user) { |
| 180 | ||
| 181 | 4 | if (err) { |
| 182 | 1 | return reply(err); |
| 183 | } | |
| 184 | ||
| 185 | 3 | if (user) { |
| 186 | 1 | var response = { |
| 187 | message: 'Email already in use.' | |
| 188 | }; | |
| 189 | ||
| 190 | 1 | return reply(response).takeover().code(409); |
| 191 | } | |
| 192 | ||
| 193 | 2 | reply(true); |
| 194 | }); | |
| 195 | } | |
| 196 | } | |
| 197 | ] | |
| 198 | }, | |
| 199 | handler: function (request, reply) { | |
| 200 | ||
| 201 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 202 | 2 | var username = request.payload.username; |
| 203 | 2 | var email = request.payload.email; |
| 204 | 2 | var password = request.payload.password; |
| 205 | ||
| 206 | 2 | User.create(username, password, email, function (err, user) { |
| 207 | ||
| 208 | 2 | if (err) { |
| 209 | 1 | return reply(err); |
| 210 | } | |
| 211 | ||
| 212 | 1 | reply(user); |
| 213 | }); | |
| 214 | } | |
| 215 | }); | |
| 216 | ||
| 217 | ||
| 218 | 2 | server.route({ |
| 219 | method: 'PUT', | |
| 220 | path: options.basePath + '/users/{id}', | |
| 221 | config: { | |
| 222 | auth: { | |
| 223 | strategy: 'session', | |
| 224 | scope: 'admin' | |
| 225 | }, | |
| 226 | validate: { | |
| 227 | payload: { | |
| 228 | isActive: Joi.boolean().required(), | |
| 229 | username: Joi.string().token().lowercase().required(), | |
| 230 | email: Joi.string().email().lowercase().required() | |
| 231 | } | |
| 232 | }, | |
| 233 | pre: [ | |
| 234 | AuthPlugin.preware.ensureAdminGroup('root'), | |
| 235 | { | |
| 236 | assign: 'usernameCheck', | |
| 237 | method: function (request, reply) { | |
| 238 | ||
| 239 | 7 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 240 | 7 | var conditions = { |
| 241 | username: request.payload.username, | |
| 242 | _id: { $ne: User._idClass(request.params.id) } | |
| 243 | }; | |
| 244 | ||
| 245 | 7 | User.findOne(conditions, function (err, user) { |
| 246 | ||
| 247 | 7 | if (err) { |
| 248 | 1 | return reply(err); |
| 249 | } | |
| 250 | ||
| 251 | 6 | if (user) { |
| 252 | 1 | var response = { |
| 253 | message: 'Username already in use.' | |
| 254 | }; | |
| 255 | ||
| 256 | 1 | return reply(response).takeover().code(409); |
| 257 | } | |
| 258 | ||
| 259 | 5 | reply(true); |
| 260 | }); | |
| 261 | } | |
| 262 | }, { | |
| 263 | assign: 'emailCheck', | |
| 264 | method: function (request, reply) { | |
| 265 | ||
| 266 | 5 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 267 | 5 | var conditions = { |
| 268 | email: request.payload.email, | |
| 269 | _id: { $ne: User._idClass(request.params.id) } | |
| 270 | }; | |
| 271 | ||
| 272 | 5 | User.findOne(conditions, function (err, user) { |
| 273 | ||
| 274 | 5 | if (err) { |
| 275 | 1 | return reply(err); |
| 276 | } | |
| 277 | ||
| 278 | 4 | if (user) { |
| 279 | 1 | var response = { |
| 280 | message: 'Email already in use.' | |
| 281 | }; | |
| 282 | ||
| 283 | 1 | return reply(response).takeover().code(409); |
| 284 | } | |
| 285 | ||
| 286 | 3 | reply(true); |
| 287 | }); | |
| 288 | } | |
| 289 | } | |
| 290 | ] | |
| 291 | }, | |
| 292 | handler: function (request, reply) { | |
| 293 | ||
| 294 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 295 | 3 | var id = request.params.id; |
| 296 | 3 | var update = { |
| 297 | $set: { | |
| 298 | isActive: request.payload.isActive, | |
| 299 | username: request.payload.username, | |
| 300 | email: request.payload.email | |
| 301 | } | |
| 302 | }; | |
| 303 | ||
| 304 | 3 | User.findByIdAndUpdate(id, update, function (err, user) { |
| 305 | ||
| 306 | 3 | if (err) { |
| 307 | 1 | return reply(err); |
| 308 | } | |
| 309 | ||
| 310 | 2 | if (!user) { |
| 311 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 312 | } | |
| 313 | ||
| 314 | 1 | reply(user); |
| 315 | }); | |
| 316 | } | |
| 317 | }); | |
| 318 | ||
| 319 | ||
| 320 | 2 | server.route({ |
| 321 | method: 'PUT', | |
| 322 | path: options.basePath + '/users/my', | |
| 323 | config: { | |
| 324 | auth: { | |
| 325 | strategy: 'session', | |
| 326 | scope: ['account', 'admin'] | |
| 327 | }, | |
| 328 | validate: { | |
| 329 | payload: { | |
| 330 | username: Joi.string().token().lowercase().required(), | |
| 331 | email: Joi.string().email().lowercase().required() | |
| 332 | } | |
| 333 | }, | |
| 334 | pre: [{ | |
| 335 | assign: 'usernameCheck', | |
| 336 | method: function (request, reply) { | |
| 337 | ||
| 338 | 6 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 339 | 6 | var conditions = { |
| 340 | username: request.payload.username, | |
| 341 | _id: { $ne: request.auth.credentials.user._id } | |
| 342 | }; | |
| 343 | ||
| 344 | 6 | User.findOne(conditions, function (err, user) { |
| 345 | ||
| 346 | 6 | if (err) { |
| 347 | 1 | return reply(err); |
| 348 | } | |
| 349 | ||
| 350 | 5 | if (user) { |
| 351 | 1 | var response = { |
| 352 | message: 'Username already in use.' | |
| 353 | }; | |
| 354 | ||
| 355 | 1 | return reply(response).takeover().code(409); |
| 356 | } | |
| 357 | ||
| 358 | 4 | reply(true); |
| 359 | }); | |
| 360 | } | |
| 361 | }, { | |
| 362 | assign: 'emailCheck', | |
| 363 | method: function (request, reply) { | |
| 364 | ||
| 365 | 4 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 366 | 4 | var conditions = { |
| 367 | email: request.payload.email, | |
| 368 | _id: { $ne: request.auth.credentials.user._id } | |
| 369 | }; | |
| 370 | ||
| 371 | 4 | User.findOne(conditions, function (err, user) { |
| 372 | ||
| 373 | 4 | if (err) { |
| 374 | 1 | return reply(err); |
| 375 | } | |
| 376 | ||
| 377 | 3 | if (user) { |
| 378 | 1 | var response = { |
| 379 | message: 'Email already in use.' | |
| 380 | }; | |
| 381 | ||
| 382 | 1 | return reply(response).takeover().code(409); |
| 383 | } | |
| 384 | ||
| 385 | 2 | reply(true); |
| 386 | }); | |
| 387 | } | |
| 388 | }] | |
| 389 | }, | |
| 390 | handler: function (request, reply) { | |
| 391 | ||
| 392 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 393 | ||
| 394 | 2 | var id = request.auth.credentials.user._id.toString(); |
| 395 | 2 | var update = { |
| 396 | $set: { | |
| 397 | username: request.payload.username, | |
| 398 | email: request.payload.email | |
| 399 | } | |
| 400 | }; | |
| 401 | 2 | var findOptions = { |
| 402 | fields: User.fieldsAdapter('username email roles') | |
| 403 | }; | |
| 404 | ||
| 405 | 2 | User.findByIdAndUpdate(id, update, findOptions, function (err, user) { |
| 406 | ||
| 407 | 2 | if (err) { |
| 408 | 1 | return reply(err); |
| 409 | } | |
| 410 | ||
| 411 | 1 | reply(user); |
| 412 | }); | |
| 413 | } | |
| 414 | }); | |
| 415 | ||
| 416 | ||
| 417 | 2 | server.route({ |
| 418 | method: 'PUT', | |
| 419 | path: options.basePath + '/users/{id}/password', | |
| 420 | config: { | |
| 421 | auth: { | |
| 422 | strategy: 'session', | |
| 423 | scope: 'admin' | |
| 424 | }, | |
| 425 | validate: { | |
| 426 | payload: { | |
| 427 | password: Joi.string().required() | |
| 428 | } | |
| 429 | }, | |
| 430 | pre: [ | |
| 431 | AuthPlugin.preware.ensureAdminGroup('root'), | |
| 432 | { | |
| 433 | assign: 'password', | |
| 434 | method: function (request, reply) { | |
| 435 | ||
| 436 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 437 | ||
| 438 | 3 | User.generatePasswordHash(request.payload.password, function (err, hash) { |
| 439 | ||
| 440 | 3 | if (err) { |
| 441 | 1 | return reply(err); |
| 442 | } | |
| 443 | ||
| 444 | 2 | reply(hash); |
| 445 | }); | |
| 446 | } | |
| 447 | } | |
| 448 | ] | |
| 449 | }, | |
| 450 | handler: function (request, reply) { | |
| 451 | ||
| 452 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 453 | 2 | var id = request.params.id; |
| 454 | 2 | var update = { |
| 455 | $set: { | |
| 456 | password: request.pre.password.hash | |
| 457 | } | |
| 458 | }; | |
| 459 | ||
| 460 | 2 | User.findByIdAndUpdate(id, update, function (err, user) { |
| 461 | ||
| 462 | 2 | if (err) { |
| 463 | 1 | return reply(err); |
| 464 | } | |
| 465 | ||
| 466 | 1 | reply(user); |
| 467 | }); | |
| 468 | } | |
| 469 | }); | |
| 470 | ||
| 471 | ||
| 472 | 2 | server.route({ |
| 473 | method: 'PUT', | |
| 474 | path: options.basePath + '/users/my/password', | |
| 475 | config: { | |
| 476 | auth: { | |
| 477 | strategy: 'session', | |
| 478 | scope: ['account', 'admin'] | |
| 479 | }, | |
| 480 | validate: { | |
| 481 | payload: { | |
| 482 | password: Joi.string().required() | |
| 483 | } | |
| 484 | }, | |
| 485 | pre: [{ | |
| 486 | assign: 'password', | |
| 487 | method: function (request, reply) { | |
| 488 | ||
| 489 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 490 | ||
| 491 | 3 | User.generatePasswordHash(request.payload.password, function (err, hash) { |
| 492 | ||
| 493 | 3 | if (err) { |
| 494 | 1 | return reply(err); |
| 495 | } | |
| 496 | ||
| 497 | 2 | reply(hash); |
| 498 | }); | |
| 499 | } | |
| 500 | }] | |
| 501 | }, | |
| 502 | handler: function (request, reply) { | |
| 503 | ||
| 504 | 2 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 505 | 2 | var id = request.auth.credentials.user._id.toString(); |
| 506 | 2 | var update = { |
| 507 | $set: { | |
| 508 | password: request.pre.password.hash | |
| 509 | } | |
| 510 | }; | |
| 511 | 2 | var findOptions = { |
| 512 | fields: User.fieldsAdapter('username email') | |
| 513 | }; | |
| 514 | ||
| 515 | 2 | User.findByIdAndUpdate(id, update, findOptions, function (err, user) { |
| 516 | ||
| 517 | 2 | if (err) { |
| 518 | 1 | return reply(err); |
| 519 | } | |
| 520 | ||
| 521 | 1 | reply(user); |
| 522 | }); | |
| 523 | } | |
| 524 | }); | |
| 525 | ||
| 526 | ||
| 527 | 2 | server.route({ |
| 528 | method: 'DELETE', | |
| 529 | path: options.basePath + '/users/{id}', | |
| 530 | config: { | |
| 531 | auth: { | |
| 532 | strategy: 'session', | |
| 533 | scope: 'admin' | |
| 534 | }, | |
| 535 | pre: [ | |
| 536 | AuthPlugin.preware.ensureAdminGroup('root') | |
| 537 | ] | |
| 538 | }, | |
| 539 | handler: function (request, reply) { | |
| 540 | ||
| 541 | 3 | var User = request.server.plugins['hapi-mongo-models'].User; |
| 542 | ||
| 543 | 3 | User.findByIdAndDelete(request.params.id, function (err, user) { |
| 544 | ||
| 545 | 3 | if (err) { |
| 546 | 1 | return reply(err); |
| 547 | } | |
| 548 | ||
| 549 | 2 | if (!user) { |
| 550 | 1 | return reply({ message: 'Document not found.' }).code(404); |
| 551 | } | |
| 552 | ||
| 553 | 1 | reply({ message: 'Success.' }); |
| 554 | }); | |
| 555 | } | |
| 556 | }); | |
| 557 | ||
| 558 | ||
| 559 | 2 | next(); |
| 560 | }; | |
| 561 | ||
| 562 | ||
| 563 | 1 | exports.register.attributes = { |
| 564 | name: 'users' | |
| 565 | }; | |
| 566 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var ObjectAssign = require('object-assign'); |
| 3 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 4 | 1 | var StatusEntry = require('./status-entry'); |
| 5 | 1 | var NoteEntry = require('./note-entry'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var Account = BaseModel.extend({ |
| 9 | constructor: function (attrs) { | |
| 10 | ||
| 11 | 7 | ObjectAssign(this, attrs); |
| 12 | } | |
| 13 | }); | |
| 14 | ||
| 15 | ||
| 16 | 1 | Account._collection = 'accounts'; |
| 17 | ||
| 18 | ||
| 19 | 1 | Account.schema = Joi.object().keys({ |
| 20 | _id: Joi.object(), | |
| 21 | user: Joi.object().keys({ | |
| 22 | id: Joi.string().required(), | |
| 23 | name: Joi.string().lowercase().required() | |
| 24 | }), | |
| 25 | name: Joi.object().keys({ | |
| 26 | first: Joi.string().required(), | |
| 27 | middle: Joi.string().allow(''), | |
| 28 | last: Joi.string().required() | |
| 29 | }), | |
| 30 | status: Joi.object().keys({ | |
| 31 | current: StatusEntry.schema, | |
| 32 | log: Joi.array().items(StatusEntry.schema) | |
| 33 | }), | |
| 34 | notes: Joi.array().items(NoteEntry.schema), | |
| 35 | verification: Joi.object().keys({ | |
| 36 | complete: Joi.boolean(), | |
| 37 | token: Joi.string() | |
| 38 | }), | |
| 39 | timeCreated: Joi.date() | |
| 40 | }); | |
| 41 | ||
| 42 | ||
| 43 | 1 | Account.indexes = [ |
| 44 | [{ 'user.id': 1 }], | |
| 45 | [{ 'user.name': 1 }] | |
| 46 | ]; | |
| 47 | ||
| 48 | ||
| 49 | 1 | Account.create = function (name, callback) { |
| 50 | ||
| 51 | 4 | var nameParts = name.trim().split(/\s/); |
| 52 | ||
| 53 | 4 | var document = { |
| 54 | name: { | |
| 55 | first: nameParts.shift(), | |
| 56 | middle: nameParts.length > 1 ? nameParts.shift() : undefined, | |
| 57 | last: nameParts.join(' ') | |
| 58 | }, | |
| 59 | timeCreated: new Date() | |
| 60 | }; | |
| 61 | ||
| 62 | 4 | this.insertOne(document, function (err, docs) { |
| 63 | ||
| 64 | 4 | if (err) { |
| 65 | 1 | return callback(err); |
| 66 | } | |
| 67 | ||
| 68 | 3 | callback(null, docs[0]); |
| 69 | }); | |
| 70 | }; | |
| 71 | ||
| 72 | ||
| 73 | 1 | Account.findByUsername = function (username, callback) { |
| 74 | ||
| 75 | 1 | var query = { 'user.name': username.toLowerCase() }; |
| 76 | 1 | this.findOne(query, callback); |
| 77 | }; | |
| 78 | ||
| 79 | ||
| 80 | 1 | module.exports = Account; |
| 81 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var ObjectAssign = require('object-assign'); |
| 3 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 4 | 1 | var Slug = require('slug'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var AdminGroup = BaseModel.extend({ |
| 8 | constructor: function (attrs) { | |
| 9 | ||
| 10 | 7 | ObjectAssign(this, attrs); |
| 11 | }, | |
| 12 | hasPermissionTo: function (permission) { | |
| 13 | ||
| 14 | 7 | if (this.permissions && this.permissions.hasOwnProperty(permission)) { |
| 15 | 4 | return this.permissions[permission]; |
| 16 | } | |
| 17 | ||
| 18 | 3 | return false; |
| 19 | } | |
| 20 | }); | |
| 21 | ||
| 22 | ||
| 23 | 1 | AdminGroup._collection = 'adminGroups'; |
| 24 | ||
| 25 | ||
| 26 | 1 | AdminGroup._idClass = String; |
| 27 | ||
| 28 | ||
| 29 | 1 | AdminGroup.schema = Joi.object().keys({ |
| 30 | _id: Joi.string(), | |
| 31 | name: Joi.string().required(), | |
| 32 | permissions: Joi.object().description('{ permission: boolean, ... }') | |
| 33 | }); | |
| 34 | ||
| 35 | ||
| 36 | 1 | AdminGroup.create = function (name, callback) { |
| 37 | ||
| 38 | 4 | var document = { |
| 39 | _id: Slug(name).toLowerCase(), | |
| 40 | name: name | |
| 41 | }; | |
| 42 | ||
| 43 | 4 | this.insertOne(document, function (err, docs) { |
| 44 | ||
| 45 | 4 | if (err) { |
| 46 | 1 | return callback(err); |
| 47 | } | |
| 48 | ||
| 49 | 3 | callback(null, docs[0]); |
| 50 | }); | |
| 51 | }; | |
| 52 | ||
| 53 | ||
| 54 | 1 | module.exports = AdminGroup; |
| 55 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Async = require('async'); |
| 3 | 1 | var ObjectAssign = require('object-assign'); |
| 4 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 5 | 1 | var AdminGroup = require('./admin-group'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var Admin = BaseModel.extend({ |
| 9 | constructor: function (attrs) { | |
| 10 | ||
| 11 | 17 | ObjectAssign(this, attrs); |
| 12 | ||
| 13 | 17 | Object.defineProperty(this, '_groups', { |
| 14 | writable: true, | |
| 15 | enumerable: false | |
| 16 | }); | |
| 17 | }, | |
| 18 | isMemberOf: function (group) { | |
| 19 | ||
| 20 | 114 | if (!this.groups) { |
| 21 | 2 | return false; |
| 22 | } | |
| 23 | ||
| 24 | 112 | return this.groups.hasOwnProperty(group); |
| 25 | }, | |
| 26 | hydrateGroups: function (callback) { | |
| 27 | ||
| 28 | 6 | if (!this.groups) { |
| 29 | 1 | this._groups = {}; |
| 30 | 1 | return callback(null, this._groups); |
| 31 | } | |
| 32 | ||
| 33 | 5 | if (this._groups) { |
| 34 | 3 | return callback(null, this._groups); |
| 35 | } | |
| 36 | ||
| 37 | 2 | var self = this; |
| 38 | 2 | var tasks = {}; |
| 39 | ||
| 40 | 2 | Object.keys(this.groups).forEach(function (group) { |
| 41 | ||
| 42 | 2 | tasks[group] = function (done) { |
| 43 | ||
| 44 | 2 | AdminGroup.findById(group, done); |
| 45 | }; | |
| 46 | }); | |
| 47 | ||
| 48 | 2 | Async.auto(tasks, function (err, results) { |
| 49 | ||
| 50 | 2 | if (err) { |
| 51 | 1 | return callback(err); |
| 52 | } | |
| 53 | ||
| 54 | 1 | self._groups = results; |
| 55 | ||
| 56 | 1 | callback(null, self._groups); |
| 57 | }); | |
| 58 | }, | |
| 59 | hasPermissionTo: function (permission, callback) { | |
| 60 | ||
| 61 | 4 | if (this.permissions && this.permissions.hasOwnProperty(permission)) { |
| 62 | 1 | return callback(null, this.permissions[permission]); |
| 63 | } | |
| 64 | ||
| 65 | 3 | var self = this; |
| 66 | ||
| 67 | 3 | this.hydrateGroups(function (err) { |
| 68 | ||
| 69 | 3 | if (err) { |
| 70 | 1 | return callback(err); |
| 71 | } | |
| 72 | ||
| 73 | 2 | var groupHasPermission = false; |
| 74 | ||
| 75 | 2 | Object.keys(self._groups).forEach(function (group) { |
| 76 | ||
| 77 | 4 | if (self._groups[group].hasPermissionTo(permission)) { |
| 78 | 1 | groupHasPermission = true; |
| 79 | } | |
| 80 | }); | |
| 81 | ||
| 82 | 2 | callback(null, groupHasPermission); |
| 83 | }); | |
| 84 | } | |
| 85 | }); | |
| 86 | ||
| 87 | ||
| 88 | 1 | Admin._collection = 'admins'; |
| 89 | ||
| 90 | ||
| 91 | 1 | Admin.schema = Joi.object().keys({ |
| 92 | _id: Joi.object(), | |
| 93 | user: Joi.object().keys({ | |
| 94 | id: Joi.string().required(), | |
| 95 | name: Joi.string().lowercase().required() | |
| 96 | }), | |
| 97 | groups: Joi.object().description('{ groupId: name, ... }'), | |
| 98 | permissions: Joi.object().description('{ permission: boolean, ... }'), | |
| 99 | name: Joi.object().keys({ | |
| 100 | first: Joi.string().required(), | |
| 101 | middle: Joi.string().allow(['', null]), | |
| 102 | last: Joi.string().required() | |
| 103 | }), | |
| 104 | timeCreated: Joi.date() | |
| 105 | }); | |
| 106 | ||
| 107 | ||
| 108 | 1 | Admin.indexes = [ |
| 109 | [{ 'user.id': 1 }], | |
| 110 | [{ 'user.name': 1 }] | |
| 111 | ]; | |
| 112 | ||
| 113 | ||
| 114 | 1 | Admin.create = function (name, callback) { |
| 115 | ||
| 116 | 4 | var nameParts = name.trim().split(/\s/); |
| 117 | ||
| 118 | 4 | var document = { |
| 119 | name: { | |
| 120 | first: nameParts.shift(), | |
| 121 | middle: nameParts.length > 1 ? nameParts.shift() : undefined, | |
| 122 | last: nameParts.join(' ') | |
| 123 | }, | |
| 124 | timeCreated: new Date() | |
| 125 | }; | |
| 126 | ||
| 127 | 4 | this.insertOne(document, function (err, docs) { |
| 128 | ||
| 129 | 4 | if (err) { |
| 130 | 1 | return callback(err); |
| 131 | } | |
| 132 | ||
| 133 | 3 | callback(null, docs[0]); |
| 134 | }); | |
| 135 | }; | |
| 136 | ||
| 137 | ||
| 138 | 1 | Admin.findByUsername = function (username, callback) { |
| 139 | ||
| 140 | 1 | var query = { 'user.name': username.toLowerCase() }; |
| 141 | 1 | this.findOne(query, callback); |
| 142 | }; | |
| 143 | ||
| 144 | ||
| 145 | 1 | module.exports = Admin; |
| 146 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Async = require('async'); |
| 3 | 1 | var ObjectAssign = require('object-assign'); |
| 4 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 5 | 1 | var Config = require('../../config'); |
| 6 | ||
| 7 | ||
| 8 | 1 | var AuthAttempt = BaseModel.extend({ |
| 9 | constructor: function (attrs) { | |
| 10 | ||
| 11 | 59 | ObjectAssign(this, attrs); |
| 12 | } | |
| 13 | }); | |
| 14 | ||
| 15 | ||
| 16 | 1 | AuthAttempt._collection = 'authAttempts'; |
| 17 | ||
| 18 | ||
| 19 | 1 | AuthAttempt.schema = Joi.object().keys({ |
| 20 | _id: Joi.object(), | |
| 21 | username: Joi.string().lowercase().required(), | |
| 22 | ip: Joi.string().required(), | |
| 23 | time: Joi.date().required() | |
| 24 | }); | |
| 25 | ||
| 26 | ||
| 27 | 1 | AuthAttempt.indexes = [ |
| 28 | [{ ip: 1, username: 1 }], | |
| 29 | [{ username: 1 }] | |
| 30 | ]; | |
| 31 | ||
| 32 | ||
| 33 | 1 | AuthAttempt.create = function (ip, username, callback) { |
| 34 | ||
| 35 | 59 | var document = { |
| 36 | ip: ip, | |
| 37 | username: username.toLowerCase(), | |
| 38 | time: new Date() | |
| 39 | }; | |
| 40 | ||
| 41 | 59 | this.insertOne(document, function (err, docs) { |
| 42 | ||
| 43 | 59 | if (err) { |
| 44 | 1 | return callback(err); |
| 45 | } | |
| 46 | ||
| 47 | 58 | callback(null, docs[0]); |
| 48 | }); | |
| 49 | }; | |
| 50 | ||
| 51 | ||
| 52 | 1 | AuthAttempt.abuseDetected = function (ip, username, callback) { |
| 53 | ||
| 54 | 4 | var self = this; |
| 55 | ||
| 56 | 4 | Async.auto({ |
| 57 | abusiveIpCount: function (done) { | |
| 58 | ||
| 59 | 4 | var query = { ip: ip }; |
| 60 | 4 | self.count(query, done); |
| 61 | }, | |
| 62 | abusiveIpUserCount: function (done) { | |
| 63 | ||
| 64 | 4 | var query = { |
| 65 | ip: ip, | |
| 66 | username: username.toLowerCase() | |
| 67 | }; | |
| 68 | ||
| 69 | 4 | self.count(query, done); |
| 70 | } | |
| 71 | }, function (err, results) { | |
| 72 | ||
| 73 | 4 | if (err) { |
| 74 | 1 | return callback(err); |
| 75 | } | |
| 76 | ||
| 77 | 3 | var authAttemptsConfig = Config.get('/authAttempts'); |
| 78 | 3 | var ipLimitReached = results.abusiveIpCount >= authAttemptsConfig.forIp; |
| 79 | 3 | var ipUserLimitReached = results.abusiveIpUserCount >= authAttemptsConfig.forIpAndUser; |
| 80 | ||
| 81 | 3 | callback(null, ipLimitReached || ipUserLimitReached); |
| 82 | }); | |
| 83 | }; | |
| 84 | ||
| 85 | ||
| 86 | 1 | module.exports = AuthAttempt; |
| 87 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var ObjectAssign = require('object-assign'); |
| 3 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 4 | ||
| 5 | ||
| 6 | 1 | var NoteEntry = BaseModel.extend({ |
| 7 | constructor: function (attrs) { | |
| 8 | ||
| 9 | 1 | ObjectAssign(this, attrs); |
| 10 | } | |
| 11 | }); | |
| 12 | ||
| 13 | ||
| 14 | 1 | NoteEntry.schema = Joi.object().keys({ |
| 15 | data: Joi.string().required(), | |
| 16 | timeCreated: Joi.date().required(), | |
| 17 | userCreated: Joi.object().keys({ | |
| 18 | id: Joi.string().required(), | |
| 19 | name: Joi.string().lowercase().required() | |
| 20 | }).required() | |
| 21 | }); | |
| 22 | ||
| 23 | ||
| 24 | 1 | module.exports = NoteEntry; |
| 25 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Uuid = require('node-uuid'); |
| 3 | 1 | var Async = require('async'); |
| 4 | 1 | var Bcrypt = require('bcrypt'); |
| 5 | 1 | var ObjectAssign = require('object-assign'); |
| 6 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 7 | ||
| 8 | ||
| 9 | 1 | var Session = BaseModel.extend({ |
| 10 | constructor: function (attrs) { | |
| 11 | ||
| 12 | 10 | ObjectAssign(this, attrs); |
| 13 | } | |
| 14 | }); | |
| 15 | ||
| 16 | ||
| 17 | 1 | Session._collection = 'sessions'; |
| 18 | ||
| 19 | ||
| 20 | 1 | Session.schema = Joi.object().keys({ |
| 21 | _id: Joi.object(), | |
| 22 | userId: Joi.string().required(), | |
| 23 | key: Joi.string().required(), | |
| 24 | time: Joi.date().required() | |
| 25 | }); | |
| 26 | ||
| 27 | ||
| 28 | 1 | Session.indexes = [ |
| 29 | [{ userId: 1 }] | |
| 30 | ]; | |
| 31 | ||
| 32 | ||
| 33 | 1 | Session.generateKeyHash = function (callback) { |
| 34 | ||
| 35 | 7 | var key = Uuid.v4(); |
| 36 | ||
| 37 | 7 | Async.auto({ |
| 38 | salt: function (done) { | |
| 39 | ||
| 40 | 7 | Bcrypt.genSalt(10, done); |
| 41 | }, | |
| 42 | hash: ['salt', function (done, results) { | |
| 43 | ||
| 44 | 6 | Bcrypt.hash(key, results.salt, done); |
| 45 | }] | |
| 46 | }, function (err, results) { | |
| 47 | ||
| 48 | 7 | if (err) { |
| 49 | 1 | return callback(err); |
| 50 | } | |
| 51 | ||
| 52 | 6 | callback(null, { |
| 53 | key: key, | |
| 54 | hash: results.hash | |
| 55 | }); | |
| 56 | }); | |
| 57 | }; | |
| 58 | ||
| 59 | ||
| 60 | 1 | Session.create = function (userId, callback) { |
| 61 | ||
| 62 | 3 | var self = this; |
| 63 | ||
| 64 | 3 | Async.auto({ |
| 65 | keyHash: this.generateKeyHash.bind(this), | |
| 66 | newSession: ['keyHash', function (done, results) { | |
| 67 | ||
| 68 | 3 | var document = { |
| 69 | userId: userId, | |
| 70 | key: results.keyHash.hash, | |
| 71 | time: new Date() | |
| 72 | }; | |
| 73 | ||
| 74 | 3 | self.insertOne(document, done); |
| 75 | }], | |
| 76 | clean: ['newSession', function (done, results) { | |
| 77 | ||
| 78 | 2 | var query = { |
| 79 | userId: userId, | |
| 80 | key: { $ne: results.keyHash.hash } | |
| 81 | }; | |
| 82 | ||
| 83 | 2 | self.deleteOne(query, done); |
| 84 | }] | |
| 85 | }, function (err, results) { | |
| 86 | ||
| 87 | 3 | if (err) { |
| 88 | 1 | return callback(err); |
| 89 | } | |
| 90 | ||
| 91 | 2 | results.newSession[0].key = results.keyHash.key; |
| 92 | ||
| 93 | 2 | callback(null, results.newSession[0]); |
| 94 | }); | |
| 95 | }; | |
| 96 | ||
| 97 | ||
| 98 | 1 | Session.findByCredentials = function (id, key, callback) { |
| 99 | ||
| 100 | 4 | var self = this; |
| 101 | ||
| 102 | 4 | Async.auto({ |
| 103 | session: function (done) { | |
| 104 | ||
| 105 | 4 | self.findById(id, done); |
| 106 | }, | |
| 107 | keyMatch: ['session', function (done, results) { | |
| 108 | ||
| 109 | 3 | if (!results.session) { |
| 110 | 1 | return done(null, false); |
| 111 | } | |
| 112 | ||
| 113 | 2 | var source = results.session.key; |
| 114 | 2 | Bcrypt.compare(key, source, done); |
| 115 | }] | |
| 116 | }, function (err, results) { | |
| 117 | ||
| 118 | 4 | if (err) { |
| 119 | 1 | return callback(err); |
| 120 | } | |
| 121 | ||
| 122 | 3 | if (results.keyMatch) { |
| 123 | 1 | return callback(null, results.session); |
| 124 | } | |
| 125 | ||
| 126 | 2 | callback(); |
| 127 | }); | |
| 128 | }; | |
| 129 | ||
| 130 | ||
| 131 | 1 | module.exports = Session; |
| 132 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var ObjectAssign = require('object-assign'); |
| 3 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 4 | ||
| 5 | ||
| 6 | 1 | var StatusEntry = BaseModel.extend({ |
| 7 | constructor: function (attrs) { | |
| 8 | ||
| 9 | 1 | ObjectAssign(this, attrs); |
| 10 | } | |
| 11 | }); | |
| 12 | ||
| 13 | ||
| 14 | 1 | StatusEntry.schema = Joi.object().keys({ |
| 15 | id: Joi.string().required(), | |
| 16 | name: Joi.string().required(), | |
| 17 | timeCreated: Joi.date().required(), | |
| 18 | userCreated: Joi.object().keys({ | |
| 19 | id: Joi.string().required(), | |
| 20 | name: Joi.string().lowercase().required() | |
| 21 | }).required() | |
| 22 | }); | |
| 23 | ||
| 24 | ||
| 25 | 1 | module.exports = StatusEntry; |
| 26 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var ObjectAssign = require('object-assign'); |
| 3 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 4 | 1 | var Slug = require('slug'); |
| 5 | ||
| 6 | ||
| 7 | 1 | var Status = BaseModel.extend({ |
| 8 | constructor: function (attrs) { | |
| 9 | ||
| 10 | 1 | ObjectAssign(this, attrs); |
| 11 | } | |
| 12 | }); | |
| 13 | ||
| 14 | ||
| 15 | 1 | Status._collection = 'statuses'; |
| 16 | ||
| 17 | ||
| 18 | 1 | Status._idClass = String; |
| 19 | ||
| 20 | ||
| 21 | 1 | Status.schema = Joi.object().keys({ |
| 22 | _id: Joi.string(), | |
| 23 | pivot: Joi.string().required(), | |
| 24 | name: Joi.string().required() | |
| 25 | }); | |
| 26 | ||
| 27 | ||
| 28 | 1 | Status.indexes = [ |
| 29 | [{ pivot: 1 }], | |
| 30 | [{ name: 1 }] | |
| 31 | ]; | |
| 32 | ||
| 33 | ||
| 34 | 1 | Status.create = function (pivot, name, callback) { |
| 35 | ||
| 36 | 2 | var document = { |
| 37 | _id: Slug(pivot + ' ' + name).toLowerCase(), | |
| 38 | pivot: pivot, | |
| 39 | name: name | |
| 40 | }; | |
| 41 | ||
| 42 | 2 | this.insertOne(document, function (err, docs) { |
| 43 | ||
| 44 | 2 | if (err) { |
| 45 | 1 | return callback(err); |
| 46 | } | |
| 47 | ||
| 48 | 1 | callback(null, docs[0]); |
| 49 | }); | |
| 50 | }; | |
| 51 | ||
| 52 | ||
| 53 | 1 | module.exports = Status; |
| 54 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | var Joi = require('joi'); |
| 2 | 1 | var Async = require('async'); |
| 3 | 1 | var Bcrypt = require('bcrypt'); |
| 4 | 1 | var ObjectAssign = require('object-assign'); |
| 5 | 1 | var BaseModel = require('hapi-mongo-models').BaseModel; |
| 6 | 1 | var Account = require('./account'); |
| 7 | 1 | var Admin = require('./admin'); |
| 8 | ||
| 9 | ||
| 10 | 1 | var User = BaseModel.extend({ |
| 11 | constructor: function (attrs) { | |
| 12 | ||
| 13 | 20 | ObjectAssign(this, attrs); |
| 14 | ||
| 15 | 20 | Object.defineProperty(this, '_roles', { |
| 16 | writable: true, | |
| 17 | enumerable: false | |
| 18 | }); | |
| 19 | }, | |
| 20 | canPlayRole: function (role) { | |
| 21 | ||
| 22 | 3 | if (!this.roles) { |
| 23 | 1 | return false; |
| 24 | } | |
| 25 | ||
| 26 | 2 | return this.roles.hasOwnProperty(role); |
| 27 | }, | |
| 28 | hydrateRoles: function (callback) { | |
| 29 | ||
| 30 | 10 | if (!this.roles) { |
| 31 | 3 | this._roles = {}; |
| 32 | 3 | return callback(null, this._roles); |
| 33 | } | |
| 34 | ||
| 35 | 7 | if (this._roles) { |
| 36 | 4 | return callback(null, this._roles); |
| 37 | } | |
| 38 | ||
| 39 | 3 | var self = this; |
| 40 | 3 | var tasks = {}; |
| 41 | ||
| 42 | 3 | if (this.roles.account) { |
| 43 | 1 | tasks.account = function (done) { |
| 44 | ||
| 45 | 1 | Account.findById(self.roles.account.id, done); |
| 46 | }; | |
| 47 | } | |
| 48 | ||
| 49 | 3 | if (this.roles.admin) { |
| 50 | 2 | tasks.admin = function (done) { |
| 51 | ||
| 52 | 2 | Admin.findById(self.roles.admin.id, done); |
| 53 | }; | |
| 54 | } | |
| 55 | ||
| 56 | 3 | Async.auto(tasks, function (err, results) { |
| 57 | ||
| 58 | 3 | if (err) { |
| 59 | 1 | return callback(err); |
| 60 | } | |
| 61 | ||
| 62 | 2 | self._roles = results; |
| 63 | ||
| 64 | 2 | callback(null, self._roles); |
| 65 | }); | |
| 66 | } | |
| 67 | }); | |
| 68 | ||
| 69 | ||
| 70 | 1 | User._collection = 'users'; |
| 71 | ||
| 72 | ||
| 73 | 1 | User.schema = Joi.object().keys({ |
| 74 | _id: Joi.object(), | |
| 75 | isActive: Joi.boolean().default(true), | |
| 76 | username: Joi.string().token().lowercase().required(), | |
| 77 | email: Joi.string().email().lowercase().required(), | |
| 78 | password: Joi.string(), | |
| 79 | roles: Joi.object().keys({ | |
| 80 | admin: Joi.object().keys({ | |
| 81 | id: Joi.string().required(), | |
| 82 | name: Joi.string().required() | |
| 83 | }), | |
| 84 | account: Joi.object().keys({ | |
| 85 | id: Joi.string().required(), | |
| 86 | name: Joi.string().required() | |
| 87 | }) | |
| 88 | }), | |
| 89 | resetPassword: Joi.object().keys({ | |
| 90 | token: Joi.string().required(), | |
| 91 | expires: Joi.date().required() | |
| 92 | }), | |
| 93 | timeCreated: Joi.date() | |
| 94 | }); | |
| 95 | ||
| 96 | ||
| 97 | 1 | User.indexes = [ |
| 98 | [{ username: 1 }, { unique: true }], | |
| 99 | [{ email: 1 }, { unique: true }] | |
| 100 | ]; | |
| 101 | ||
| 102 | ||
| 103 | 1 | User.generatePasswordHash = function (password, callback) { |
| 104 | ||
| 105 | 7 | Async.auto({ |
| 106 | salt: function (done) { | |
| 107 | ||
| 108 | 7 | Bcrypt.genSalt(10, done); |
| 109 | }, | |
| 110 | hash: ['salt', function (done, results) { | |
| 111 | ||
| 112 | 6 | Bcrypt.hash(password, results.salt, done); |
| 113 | }] | |
| 114 | }, function (err, results) { | |
| 115 | ||
| 116 | 7 | if (err) { |
| 117 | 1 | return callback(err); |
| 118 | } | |
| 119 | ||
| 120 | 6 | callback(null, { |
| 121 | password: password, | |
| 122 | hash: results.hash | |
| 123 | }); | |
| 124 | }); | |
| 125 | }; | |
| 126 | ||
| 127 | 1 | User.create = function (username, password, email, callback) { |
| 128 | ||
| 129 | 4 | var self = this; |
| 130 | ||
| 131 | 4 | Async.auto({ |
| 132 | passwordHash: this.generatePasswordHash.bind(this, password), | |
| 133 | newUser: ['passwordHash', function (done, results) { | |
| 134 | ||
| 135 | 4 | var document = { |
| 136 | isActive: true, | |
| 137 | username: username.toLowerCase(), | |
| 138 | email: email.toLowerCase(), | |
| 139 | password: results.passwordHash.hash, | |
| 140 | timeCreated: new Date() | |
| 141 | }; | |
| 142 | ||
| 143 | 4 | self.insertOne(document, done); |
| 144 | }] | |
| 145 | }, function (err, results) { | |
| 146 | ||
| 147 | 4 | if (err) { |
| 148 | 1 | return callback(err); |
| 149 | } | |
| 150 | ||
| 151 | 3 | results.newUser[0].password = results.passwordHash.password; |
| 152 | ||
| 153 | 3 | callback(null, results.newUser[0]); |
| 154 | }); | |
| 155 | }; | |
| 156 | ||
| 157 | ||
| 158 | 1 | User.findByCredentials = function (username, password, callback) { |
| 159 | ||
| 160 | 5 | var self = this; |
| 161 | ||
| 162 | 5 | Async.auto({ |
| 163 | user: function (done) { | |
| 164 | ||
| 165 | 5 | var query = { |
| 166 | isActive: true | |
| 167 | }; | |
| 168 | ||
| 169 | 5 | if (username.indexOf('@') > -1) { |
| 170 | 1 | query.email = username.toLowerCase(); |
| 171 | } | |
| 172 | else { | |
| 173 | 4 | query.username = username.toLowerCase(); |
| 174 | } | |
| 175 | ||
| 176 | 5 | self.findOne(query, done); |
| 177 | }, | |
| 178 | passwordMatch: ['user', function (done, results) { | |
| 179 | ||
| 180 | 4 | if (!results.user) { |
| 181 | 1 | return done(null, false); |
| 182 | } | |
| 183 | ||
| 184 | 3 | var source = results.user.password; |
| 185 | 3 | Bcrypt.compare(password, source, done); |
| 186 | }] | |
| 187 | }, function (err, results) { | |
| 188 | ||
| 189 | 5 | if (err) { |
| 190 | 1 | return callback(err); |
| 191 | } | |
| 192 | ||
| 193 | 4 | if (results.passwordMatch) { |
| 194 | 2 | return callback(null, results.user); |
| 195 | } | |
| 196 | ||
| 197 | 2 | callback(); |
| 198 | }); | |
| 199 | }; | |
| 200 | ||
| 201 | ||
| 202 | 1 | User.findByUsername = function (username, callback) { |
| 203 | ||
| 204 | 1 | var query = { username: username.toLowerCase() }; |
| 205 | 1 | this.findOne(query, callback); |
| 206 | }; | |
| 207 | ||
| 208 | ||
| 209 | 1 | module.exports = User; |
| 210 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 1 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/public/{param*}', | |
| 6 | handler: { | |
| 7 | directory: { | |
| 8 | path: 'public', | |
| 9 | listing: true | |
| 10 | } | |
| 11 | } | |
| 12 | }); | |
| 13 | ||
| 14 | ||
| 15 | 1 | next(); |
| 16 | }; | |
| 17 | ||
| 18 | ||
| 19 | 1 | exports.register.attributes = { |
| 20 | name: 'public' | |
| 21 | }; | |
| 22 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 2 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/about', | |
| 6 | handler: function (request, reply) { | |
| 7 | ||
| 8 | 1 | reply.view('about/index'); |
| 9 | } | |
| 10 | }); | |
| 11 | ||
| 12 | ||
| 13 | 2 | next(); |
| 14 | }; | |
| 15 | ||
| 16 | ||
| 17 | 1 | exports.register.attributes = { |
| 18 | name: 'web/about' | |
| 19 | }; | |
| 20 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/about/index.jsx | 1 | |
| 2 | server/web/about/index.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/about/index.jsx | 1 |
| 4 | 1 | var Layout = require('../layouts/Default.jsx'); | server/web/about/index.jsx | 2 |
| 5 | server/web/about/index.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/about/index.jsx | 5 |
| 7 | displayName: 'Component', | server/web/about/index.jsx | 5 | |
| 8 | server/web/about/index.jsx | 5 | ||
| 9 | render: function render() { | server/web/about/index.jsx | 6 | |
| 10 | server/web/about/index.jsx | 6 | ||
| 11 | 1 | return React.createElement( | server/web/about/index.jsx | 8 |
| 12 | Layout, | server/web/about/index.jsx | 9 | |
| 13 | { | server/web/about/index.jsx | 9 | |
| 14 | title: 'About us', | server/web/about/index.jsx | 10 | |
| 15 | activeTab: 'about' }, | server/web/about/index.jsx | 11 | |
| 16 | React.createElement( | server/web/about/index.jsx | 11 | |
| 17 | 'div', | server/web/about/index.jsx | 13 | |
| 18 | { className: 'row' }, | server/web/about/index.jsx | 13 | |
| 19 | React.createElement( | server/web/about/index.jsx | 13 | |
| 20 | 'div', | server/web/about/index.jsx | 14 | |
| 21 | { className: 'col-sm-6' }, | server/web/about/index.jsx | 14 | |
| 22 | React.createElement( | server/web/about/index.jsx | 14 | |
| 23 | 'h1', | server/web/about/index.jsx | 15 | |
| 24 | { className: 'page-header' }, | server/web/about/index.jsx | 15 | |
| 25 | 'About us' | server/web/about/index.jsx | 15 | |
| 26 | ), | server/web/about/index.jsx | 15 | |
| 27 | React.createElement( | server/web/about/index.jsx | 15 | |
| 28 | 'div', | server/web/about/index.jsx | 16 | |
| 29 | { className: 'media' }, | server/web/about/index.jsx | 16 | |
| 30 | React.createElement( | server/web/about/index.jsx | 16 | |
| 31 | 'div', | server/web/about/index.jsx | 17 | |
| 32 | { className: 'pull-left' }, | server/web/about/index.jsx | 17 | |
| 33 | React.createElement( | server/web/about/index.jsx | 17 | |
| 34 | 'div', | server/web/about/index.jsx | 18 | |
| 35 | { className: 'media-object' }, | server/web/about/index.jsx | 18 | |
| 36 | React.createElement('i', { className: 'fa fa-camera-retro fa-4x' }) | server/web/about/index.jsx | 18 | |
| 37 | ) | server/web/about/index.jsx | 19 | |
| 38 | ), | server/web/about/index.jsx | 20 | |
| 39 | React.createElement( | server/web/about/index.jsx | 21 | |
| 40 | 'div', | server/web/about/index.jsx | 22 | |
| 41 | { className: 'media-body' }, | server/web/about/index.jsx | 22 | |
| 42 | React.createElement( | server/web/about/index.jsx | 22 | |
| 43 | 'h4', | server/web/about/index.jsx | 23 | |
| 44 | { className: 'media-heading' }, | server/web/about/index.jsx | 23 | |
| 45 | 'Leo Damon' | server/web/about/index.jsx | 23 | |
| 46 | ), | server/web/about/index.jsx | 23 | |
| 47 | React.createElement( | server/web/about/index.jsx | 23 | |
| 48 | 'p', | server/web/about/index.jsx | 24 | |
| 49 | null, | server/web/about/index.jsx | 24 | |
| 50 | 'Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.' | server/web/about/index.jsx | 24 | |
| 51 | ) | server/web/about/index.jsx | 24 | |
| 52 | ) | server/web/about/index.jsx | 30 | |
| 53 | ), | server/web/about/index.jsx | 31 | |
| 54 | React.createElement( | server/web/about/index.jsx | 32 | |
| 55 | 'div', | server/web/about/index.jsx | 33 | |
| 56 | { className: 'media text-right' }, | server/web/about/index.jsx | 33 | |
| 57 | React.createElement( | server/web/about/index.jsx | 33 | |
| 58 | 'div', | server/web/about/index.jsx | 34 | |
| 59 | { className: 'pull-right' }, | server/web/about/index.jsx | 34 | |
| 60 | React.createElement( | server/web/about/index.jsx | 34 | |
| 61 | 'div', | server/web/about/index.jsx | 35 | |
| 62 | { className: 'media-object' }, | server/web/about/index.jsx | 35 | |
| 63 | React.createElement('i', { className: 'fa fa-camera-retro fa-4x' }) | server/web/about/index.jsx | 35 | |
| 64 | ) | server/web/about/index.jsx | 36 | |
| 65 | ), | server/web/about/index.jsx | 37 | |
| 66 | React.createElement( | server/web/about/index.jsx | 38 | |
| 67 | 'div', | server/web/about/index.jsx | 39 | |
| 68 | { className: 'media-body' }, | server/web/about/index.jsx | 39 | |
| 69 | React.createElement( | server/web/about/index.jsx | 39 | |
| 70 | 'h4', | server/web/about/index.jsx | 40 | |
| 71 | { className: 'media-heading' }, | server/web/about/index.jsx | 40 | |
| 72 | 'Mathew DiCaprio' | server/web/about/index.jsx | 40 | |
| 73 | ), | server/web/about/index.jsx | 40 | |
| 74 | React.createElement( | server/web/about/index.jsx | 40 | |
| 75 | 'p', | server/web/about/index.jsx | 41 | |
| 76 | null, | server/web/about/index.jsx | 41 | |
| 77 | 'Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.' | server/web/about/index.jsx | 41 | |
| 78 | ) | server/web/about/index.jsx | 41 | |
| 79 | ) | server/web/about/index.jsx | 47 | |
| 80 | ), | server/web/about/index.jsx | 48 | |
| 81 | React.createElement( | server/web/about/index.jsx | 49 | |
| 82 | 'div', | server/web/about/index.jsx | 50 | |
| 83 | { className: 'media' }, | server/web/about/index.jsx | 50 | |
| 84 | React.createElement( | server/web/about/index.jsx | 50 | |
| 85 | 'div', | server/web/about/index.jsx | 51 | |
| 86 | { className: 'pull-left' }, | server/web/about/index.jsx | 51 | |
| 87 | React.createElement( | server/web/about/index.jsx | 51 | |
| 88 | 'div', | server/web/about/index.jsx | 52 | |
| 89 | { className: 'media-object' }, | server/web/about/index.jsx | 52 | |
| 90 | React.createElement('i', { className: 'fa fa-camera-retro fa-4x' }) | server/web/about/index.jsx | 52 | |
| 91 | ) | server/web/about/index.jsx | 53 | |
| 92 | ), | server/web/about/index.jsx | 54 | |
| 93 | React.createElement( | server/web/about/index.jsx | 55 | |
| 94 | 'div', | server/web/about/index.jsx | 56 | |
| 95 | { className: 'media-body' }, | server/web/about/index.jsx | 56 | |
| 96 | React.createElement( | server/web/about/index.jsx | 56 | |
| 97 | 'h4', | server/web/about/index.jsx | 57 | |
| 98 | { className: 'media-heading' }, | server/web/about/index.jsx | 57 | |
| 99 | 'Nick Jackson' | server/web/about/index.jsx | 57 | |
| 100 | ), | server/web/about/index.jsx | 57 | |
| 101 | React.createElement( | server/web/about/index.jsx | 57 | |
| 102 | 'p', | server/web/about/index.jsx | 58 | |
| 103 | null, | server/web/about/index.jsx | 58 | |
| 104 | 'Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.' | server/web/about/index.jsx | 58 | |
| 105 | ) | server/web/about/index.jsx | 58 | |
| 106 | ) | server/web/about/index.jsx | 64 | |
| 107 | ) | server/web/about/index.jsx | 65 | |
| 108 | ), | server/web/about/index.jsx | 66 | |
| 109 | React.createElement( | server/web/about/index.jsx | 67 | |
| 110 | 'div', | server/web/about/index.jsx | 68 | |
| 111 | { className: 'col-sm-6 text-center' }, | server/web/about/index.jsx | 68 | |
| 112 | React.createElement( | server/web/about/index.jsx | 68 | |
| 113 | 'h1', | server/web/about/index.jsx | 69 | |
| 114 | { className: 'page-header' }, | server/web/about/index.jsx | 69 | |
| 115 | 'Prestige worldwide' | server/web/about/index.jsx | 69 | |
| 116 | ), | server/web/about/index.jsx | 69 | |
| 117 | React.createElement( | server/web/about/index.jsx | 69 | |
| 118 | 'p', | server/web/about/index.jsx | 70 | |
| 119 | { className: 'lead' }, | server/web/about/index.jsx | 70 | |
| 120 | 'The first name in entertainment.' | server/web/about/index.jsx | 70 | |
| 121 | ), | server/web/about/index.jsx | 70 | |
| 122 | React.createElement('i', { className: 'fa fa-volume-up bamf' }) | server/web/about/index.jsx | 72 | |
| 123 | ) | server/web/about/index.jsx | 73 | |
| 124 | ) | server/web/about/index.jsx | 74 | |
| 125 | ); | server/web/about/index.jsx | 75 | |
| 126 | } | server/web/about/index.jsx | 77 | |
| 127 | }); | server/web/about/index.jsx | 78 | |
| 128 | server/web/about/index.jsx | 79 | ||
| 129 | 1 | module.exports = Component; | server/web/about/index.jsx | 82 |
| 130 | server/web/about/index.jsx | 82 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 2 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/account/{glob*}', | |
| 6 | config: { | |
| 7 | auth: { | |
| 8 | strategy: 'session', | |
| 9 | scope: 'account' | |
| 10 | } | |
| 11 | }, | |
| 12 | handler: function (request, reply) { | |
| 13 | ||
| 14 | 1 | reply.view('account/index'); |
| 15 | } | |
| 16 | }); | |
| 17 | ||
| 18 | ||
| 19 | 2 | next(); |
| 20 | }; | |
| 21 | ||
| 22 | ||
| 23 | 1 | exports.register.attributes = { |
| 24 | name: 'web/account' | |
| 25 | }; | |
| 26 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/account/index.jsx | 1 | |
| 2 | server/web/account/index.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/account/index.jsx | 1 |
| 4 | 1 | var Layout = require('../layouts/Plain.jsx'); | server/web/account/index.jsx | 2 |
| 5 | server/web/account/index.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/account/index.jsx | 5 |
| 7 | displayName: 'Component', | server/web/account/index.jsx | 5 | |
| 8 | server/web/account/index.jsx | 5 | ||
| 9 | render: function render() { | server/web/account/index.jsx | 6 | |
| 10 | server/web/account/index.jsx | 6 | ||
| 11 | 1 | var neck = [React.createElement('link', { key: 'layout', rel: 'stylesheet', href: '/public/layouts/default.min.css' }), React.createElement('link', { key: 'page', rel: 'stylesheet', href: '/public/pages/account.min.css' })]; | server/web/account/index.jsx | 8 |
| 12 | 1 | var feet = React.createElement('script', { src: '/public/pages/account.min.js' }); | server/web/account/index.jsx | 12 |
| 13 | server/web/account/index.jsx | 12 | ||
| 14 | 1 | return React.createElement( | server/web/account/index.jsx | 14 |
| 15 | Layout, | server/web/account/index.jsx | 15 | |
| 16 | { | server/web/account/index.jsx | 15 | |
| 17 | title: 'Account', | server/web/account/index.jsx | 16 | |
| 18 | neck: neck, | server/web/account/index.jsx | 17 | |
| 19 | feet: feet }, | server/web/account/index.jsx | 18 | |
| 20 | React.createElement('div', { id: 'app-mount' }) | server/web/account/index.jsx | 18 | |
| 21 | ); | server/web/account/index.jsx | 20 | |
| 22 | } | server/web/account/index.jsx | 22 | |
| 23 | }); | server/web/account/index.jsx | 23 | |
| 24 | server/web/account/index.jsx | 24 | ||
| 25 | 1 | module.exports = Component; | server/web/account/index.jsx | 27 |
| 26 | server/web/account/index.jsx | 27 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 2 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/admin/{glob*}', | |
| 6 | config: { | |
| 7 | auth: { | |
| 8 | strategy: 'session', | |
| 9 | scope: 'admin' | |
| 10 | } | |
| 11 | }, | |
| 12 | handler: function (request, reply) { | |
| 13 | ||
| 14 | 1 | reply.view('admin/index'); |
| 15 | } | |
| 16 | }); | |
| 17 | ||
| 18 | ||
| 19 | 2 | next(); |
| 20 | }; | |
| 21 | ||
| 22 | ||
| 23 | 1 | exports.register.attributes = { |
| 24 | name: 'web/admin' | |
| 25 | }; | |
| 26 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/admin/index.jsx | 1 | |
| 2 | server/web/admin/index.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/admin/index.jsx | 1 |
| 4 | 1 | var Layout = require('../layouts/Plain.jsx'); | server/web/admin/index.jsx | 2 |
| 5 | server/web/admin/index.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/admin/index.jsx | 5 |
| 7 | displayName: 'Component', | server/web/admin/index.jsx | 5 | |
| 8 | server/web/admin/index.jsx | 5 | ||
| 9 | render: function render() { | server/web/admin/index.jsx | 6 | |
| 10 | server/web/admin/index.jsx | 6 | ||
| 11 | 1 | var neck = [React.createElement('link', { key: 'layout', rel: 'stylesheet', href: '/public/layouts/default.min.css' }), React.createElement('link', { key: 'page', rel: 'stylesheet', href: '/public/pages/admin.min.css' })]; | server/web/admin/index.jsx | 8 |
| 12 | 1 | var feet = React.createElement('script', { src: '/public/pages/admin.min.js' }); | server/web/admin/index.jsx | 12 |
| 13 | server/web/admin/index.jsx | 12 | ||
| 14 | 1 | return React.createElement( | server/web/admin/index.jsx | 14 |
| 15 | Layout, | server/web/admin/index.jsx | 15 | |
| 16 | { | server/web/admin/index.jsx | 15 | |
| 17 | title: 'Admin', | server/web/admin/index.jsx | 16 | |
| 18 | neck: neck, | server/web/admin/index.jsx | 17 | |
| 19 | feet: feet }, | server/web/admin/index.jsx | 18 | |
| 20 | React.createElement('div', { id: 'app-mount' }) | server/web/admin/index.jsx | 18 | |
| 21 | ); | server/web/admin/index.jsx | 20 | |
| 22 | } | server/web/admin/index.jsx | 22 | |
| 23 | }); | server/web/admin/index.jsx | 23 | |
| 24 | server/web/admin/index.jsx | 24 | ||
| 25 | 1 | module.exports = Component; | server/web/admin/index.jsx | 27 |
| 26 | server/web/admin/index.jsx | 27 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 2 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/contact', | |
| 6 | handler: function (request, reply) { | |
| 7 | ||
| 8 | 1 | reply.view('contact/index'); |
| 9 | } | |
| 10 | }); | |
| 11 | ||
| 12 | ||
| 13 | 2 | next(); |
| 14 | }; | |
| 15 | ||
| 16 | ||
| 17 | 1 | exports.register.attributes = { |
| 18 | name: 'web/contact' | |
| 19 | }; | |
| 20 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/contact/index.jsx | 1 | |
| 2 | server/web/contact/index.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/contact/index.jsx | 1 |
| 4 | 1 | var Layout = require('../layouts/Default.jsx'); | server/web/contact/index.jsx | 2 |
| 5 | server/web/contact/index.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/contact/index.jsx | 5 |
| 7 | displayName: 'Component', | server/web/contact/index.jsx | 5 | |
| 8 | server/web/contact/index.jsx | 5 | ||
| 9 | render: function render() { | server/web/contact/index.jsx | 6 | |
| 10 | server/web/contact/index.jsx | 6 | ||
| 11 | 1 | var feet = React.createElement('script', { src: '/public/pages/contact.min.js' }); | server/web/contact/index.jsx | 8 |
| 12 | server/web/contact/index.jsx | 8 | ||
| 13 | 1 | return React.createElement( | server/web/contact/index.jsx | 10 |
| 14 | Layout, | server/web/contact/index.jsx | 11 | |
| 15 | { | server/web/contact/index.jsx | 11 | |
| 16 | title: 'Contact us', | server/web/contact/index.jsx | 12 | |
| 17 | feet: feet, | server/web/contact/index.jsx | 13 | |
| 18 | activeTab: 'contact' }, | server/web/contact/index.jsx | 14 | |
| 19 | React.createElement( | server/web/contact/index.jsx | 14 | |
| 20 | 'div', | server/web/contact/index.jsx | 16 | |
| 21 | { className: 'row' }, | server/web/contact/index.jsx | 16 | |
| 22 | React.createElement('div', { className: 'col-sm-6', id: 'app-mount' }), | server/web/contact/index.jsx | 16 | |
| 23 | React.createElement( | server/web/contact/index.jsx | 17 | |
| 24 | 'div', | server/web/contact/index.jsx | 18 | |
| 25 | { className: 'col-sm-6 text-center' }, | server/web/contact/index.jsx | 18 | |
| 26 | React.createElement( | server/web/contact/index.jsx | 18 | |
| 27 | 'h1', | server/web/contact/index.jsx | 19 | |
| 28 | { className: 'page-header' }, | server/web/contact/index.jsx | 19 | |
| 29 | 'Contact us' | server/web/contact/index.jsx | 19 | |
| 30 | ), | server/web/contact/index.jsx | 19 | |
| 31 | React.createElement( | server/web/contact/index.jsx | 19 | |
| 32 | 'p', | server/web/contact/index.jsx | 20 | |
| 33 | { className: 'lead' }, | server/web/contact/index.jsx | 20 | |
| 34 | 'Freddy can\'t wait to hear from you.' | server/web/contact/index.jsx | 20 | |
| 35 | ), | server/web/contact/index.jsx | 20 | |
| 36 | React.createElement('i', { className: 'fa fa-reply-all bamf' }), | server/web/contact/index.jsx | 22 | |
| 37 | React.createElement( | server/web/contact/index.jsx | 23 | |
| 38 | 'div', | server/web/contact/index.jsx | 24 | |
| 39 | null, | server/web/contact/index.jsx | 24 | |
| 40 | '1428 Elm Street • San Francisco, CA 94122' | server/web/contact/index.jsx | 24 | |
| 41 | ) | server/web/contact/index.jsx | 24 | |
| 42 | ) | server/web/contact/index.jsx | 26 | |
| 43 | ) | server/web/contact/index.jsx | 27 | |
| 44 | ); | server/web/contact/index.jsx | 28 | |
| 45 | } | server/web/contact/index.jsx | 30 | |
| 46 | }); | server/web/contact/index.jsx | 31 | |
| 47 | server/web/contact/index.jsx | 32 | ||
| 48 | 1 | module.exports = Component; | server/web/contact/index.jsx | 35 |
| 49 | server/web/contact/index.jsx | 35 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 2 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/', | |
| 6 | handler: function (request, reply) { | |
| 7 | ||
| 8 | 1 | return reply.view('home/index'); |
| 9 | } | |
| 10 | }); | |
| 11 | ||
| 12 | ||
| 13 | 2 | next(); |
| 14 | }; | |
| 15 | ||
| 16 | ||
| 17 | 1 | exports.register.attributes = { |
| 18 | name: 'web/home' | |
| 19 | }; | |
| 20 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/home/index.jsx | 1 | |
| 2 | server/web/home/index.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/home/index.jsx | 1 |
| 4 | 1 | var Layout = require('../layouts/Default.jsx'); | server/web/home/index.jsx | 2 |
| 5 | server/web/home/index.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/home/index.jsx | 5 |
| 7 | displayName: 'Component', | server/web/home/index.jsx | 5 | |
| 8 | server/web/home/index.jsx | 5 | ||
| 9 | render: function render() { | server/web/home/index.jsx | 6 | |
| 10 | server/web/home/index.jsx | 6 | ||
| 11 | 1 | var neck = React.createElement('link', { rel: 'stylesheet', href: '/public/pages/home.min.css' }); | server/web/home/index.jsx | 8 |
| 12 | server/web/home/index.jsx | 8 | ||
| 13 | 1 | return React.createElement( | server/web/home/index.jsx | 10 |
| 14 | Layout, | server/web/home/index.jsx | 11 | |
| 15 | { | server/web/home/index.jsx | 11 | |
| 16 | title: 'Aqua', | server/web/home/index.jsx | 12 | |
| 17 | neck: neck, | server/web/home/index.jsx | 13 | |
| 18 | activeTab: 'home' }, | server/web/home/index.jsx | 14 | |
| 19 | React.createElement( | server/web/home/index.jsx | 14 | |
| 20 | 'div', | server/web/home/index.jsx | 16 | |
| 21 | { className: 'jumbotron' }, | server/web/home/index.jsx | 16 | |
| 22 | React.createElement( | server/web/home/index.jsx | 16 | |
| 23 | 'h1', | server/web/home/index.jsx | 17 | |
| 24 | null, | server/web/home/index.jsx | 17 | |
| 25 | 'Success' | server/web/home/index.jsx | 17 | |
| 26 | ), | server/web/home/index.jsx | 17 | |
| 27 | React.createElement( | server/web/home/index.jsx | 17 | |
| 28 | 'p', | server/web/home/index.jsx | 18 | |
| 29 | { className: 'lead' }, | server/web/home/index.jsx | 18 | |
| 30 | 'Your Node.js website and user system is running. May the force be with you.', | server/web/home/index.jsx | 18 | |
| 31 | React.createElement( | server/web/home/index.jsx | 18 | |
| 32 | 'div', | server/web/home/index.jsx | 22 | |
| 33 | null, | server/web/home/index.jsx | 22 | |
| 34 | React.createElement( | server/web/home/index.jsx | 22 | |
| 35 | 'a', | server/web/home/index.jsx | 23 | |
| 36 | { className: 'btn btn-primary btn-lg', href: '/signup' }, | server/web/home/index.jsx | 23 | |
| 37 | 'Create an account' | server/web/home/index.jsx | 23 | |
| 38 | ), | server/web/home/index.jsx | 23 | |
| 39 | ' or  ', | server/web/home/index.jsx | 25 | |
| 40 | React.createElement( | server/web/home/index.jsx | 25 | |
| 41 | 'a', | server/web/home/index.jsx | 27 | |
| 42 | { className: 'btn btn-warning btn-lg', href: '/login/forgot' }, | server/web/home/index.jsx | 27 | |
| 43 | 'Reset your password' | server/web/home/index.jsx | 27 | |
| 44 | ) | server/web/home/index.jsx | 27 | |
| 45 | ) | server/web/home/index.jsx | 29 | |
| 46 | ) | server/web/home/index.jsx | 30 | |
| 47 | ), | server/web/home/index.jsx | 31 | |
| 48 | React.createElement( | server/web/home/index.jsx | 32 | |
| 49 | 'div', | server/web/home/index.jsx | 33 | |
| 50 | { className: 'row' }, | server/web/home/index.jsx | 33 | |
| 51 | React.createElement( | server/web/home/index.jsx | 33 | |
| 52 | 'div', | server/web/home/index.jsx | 34 | |
| 53 | { className: 'col-sm-4' }, | server/web/home/index.jsx | 34 | |
| 54 | React.createElement( | server/web/home/index.jsx | 34 | |
| 55 | 'div', | server/web/home/index.jsx | 35 | |
| 56 | { className: 'panel panel-default' }, | server/web/home/index.jsx | 35 | |
| 57 | React.createElement( | server/web/home/index.jsx | 35 | |
| 58 | 'div', | server/web/home/index.jsx | 36 | |
| 59 | { className: 'panel-body' }, | server/web/home/index.jsx | 36 | |
| 60 | React.createElement( | server/web/home/index.jsx | 36 | |
| 61 | 'h3', | server/web/home/index.jsx | 37 | |
| 62 | null, | server/web/home/index.jsx | 37 | |
| 63 | 'About us' | server/web/home/index.jsx | 37 | |
| 64 | ), | server/web/home/index.jsx | 37 | |
| 65 | React.createElement( | server/web/home/index.jsx | 37 | |
| 66 | 'p', | server/web/home/index.jsx | 38 | |
| 67 | null, | server/web/home/index.jsx | 38 | |
| 68 | 'At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti.' | server/web/home/index.jsx | 38 | |
| 69 | ), | server/web/home/index.jsx | 38 | |
| 70 | React.createElement( | server/web/home/index.jsx | 43 | |
| 71 | 'a', | server/web/home/index.jsx | 44 | |
| 72 | { href: '/about', className: 'btn btn-default btn-block' }, | server/web/home/index.jsx | 44 | |
| 73 | 'Learn more' | server/web/home/index.jsx | 44 | |
| 74 | ) | server/web/home/index.jsx | 44 | |
| 75 | ) | server/web/home/index.jsx | 46 | |
| 76 | ) | server/web/home/index.jsx | 47 | |
| 77 | ), | server/web/home/index.jsx | 48 | |
| 78 | React.createElement( | server/web/home/index.jsx | 49 | |
| 79 | 'div', | server/web/home/index.jsx | 50 | |
| 80 | { className: 'col-sm-4' }, | server/web/home/index.jsx | 50 | |
| 81 | React.createElement( | server/web/home/index.jsx | 50 | |
| 82 | 'div', | server/web/home/index.jsx | 51 | |
| 83 | { className: 'panel panel-default' }, | server/web/home/index.jsx | 51 | |
| 84 | React.createElement( | server/web/home/index.jsx | 51 | |
| 85 | 'div', | server/web/home/index.jsx | 52 | |
| 86 | { className: 'panel-body' }, | server/web/home/index.jsx | 52 | |
| 87 | React.createElement( | server/web/home/index.jsx | 52 | |
| 88 | 'h3', | server/web/home/index.jsx | 53 | |
| 89 | null, | server/web/home/index.jsx | 53 | |
| 90 | 'Sign up' | server/web/home/index.jsx | 53 | |
| 91 | ), | server/web/home/index.jsx | 53 | |
| 92 | React.createElement( | server/web/home/index.jsx | 53 | |
| 93 | 'p', | server/web/home/index.jsx | 54 | |
| 94 | null, | server/web/home/index.jsx | 54 | |
| 95 | 'At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti.' | server/web/home/index.jsx | 54 | |
| 96 | ), | server/web/home/index.jsx | 54 | |
| 97 | React.createElement( | server/web/home/index.jsx | 59 | |
| 98 | 'a', | server/web/home/index.jsx | 60 | |
| 99 | { href: '/signup', className: 'btn btn-default btn-block' }, | server/web/home/index.jsx | 60 | |
| 100 | 'Learn more' | server/web/home/index.jsx | 60 | |
| 101 | ) | server/web/home/index.jsx | 60 | |
| 102 | ) | server/web/home/index.jsx | 62 | |
| 103 | ) | server/web/home/index.jsx | 63 | |
| 104 | ), | server/web/home/index.jsx | 64 | |
| 105 | React.createElement( | server/web/home/index.jsx | 65 | |
| 106 | 'div', | server/web/home/index.jsx | 66 | |
| 107 | { className: 'col-sm-4' }, | server/web/home/index.jsx | 66 | |
| 108 | React.createElement( | server/web/home/index.jsx | 66 | |
| 109 | 'div', | server/web/home/index.jsx | 67 | |
| 110 | { className: 'panel panel-default' }, | server/web/home/index.jsx | 67 | |
| 111 | React.createElement( | server/web/home/index.jsx | 67 | |
| 112 | 'div', | server/web/home/index.jsx | 68 | |
| 113 | { className: 'panel-body' }, | server/web/home/index.jsx | 68 | |
| 114 | React.createElement( | server/web/home/index.jsx | 68 | |
| 115 | 'h3', | server/web/home/index.jsx | 69 | |
| 116 | null, | server/web/home/index.jsx | 69 | |
| 117 | 'Contact us' | server/web/home/index.jsx | 69 | |
| 118 | ), | server/web/home/index.jsx | 69 | |
| 119 | React.createElement( | server/web/home/index.jsx | 69 | |
| 120 | 'p', | server/web/home/index.jsx | 70 | |
| 121 | null, | server/web/home/index.jsx | 70 | |
| 122 | 'At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti.' | server/web/home/index.jsx | 70 | |
| 123 | ), | server/web/home/index.jsx | 70 | |
| 124 | React.createElement( | server/web/home/index.jsx | 75 | |
| 125 | 'a', | server/web/home/index.jsx | 76 | |
| 126 | { href: '/contact', className: 'btn btn-default btn-block' }, | server/web/home/index.jsx | 76 | |
| 127 | 'Learn more' | server/web/home/index.jsx | 76 | |
| 128 | ) | server/web/home/index.jsx | 76 | |
| 129 | ) | server/web/home/index.jsx | 78 | |
| 130 | ) | server/web/home/index.jsx | 79 | |
| 131 | ) | server/web/home/index.jsx | 80 | |
| 132 | ) | server/web/home/index.jsx | 81 | |
| 133 | ); | server/web/home/index.jsx | 82 | |
| 134 | } | server/web/home/index.jsx | 84 | |
| 135 | }); | server/web/home/index.jsx | 85 | |
| 136 | server/web/home/index.jsx | 86 | ||
| 137 | 1 | module.exports = Component; | server/web/home/index.jsx | 89 |
| 138 | server/web/home/index.jsx | 89 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/layouts/Default.jsx | 1 | |
| 2 | server/web/layouts/Default.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/layouts/Default.jsx | 1 |
| 4 | 1 | var NavBar = require('./NavBar.jsx'); | server/web/layouts/Default.jsx | 2 |
| 5 | server/web/layouts/Default.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/layouts/Default.jsx | 5 |
| 7 | displayName: 'Component', | server/web/layouts/Default.jsx | 5 | |
| 8 | server/web/layouts/Default.jsx | 5 | ||
| 9 | render: function render() { | server/web/layouts/Default.jsx | 6 | |
| 10 | server/web/layouts/Default.jsx | 6 | ||
| 11 | 1 | return React.createElement( | server/web/layouts/Default.jsx | 8 |
| 12 | 'html', | server/web/layouts/Default.jsx | 9 | |
| 13 | null, | server/web/layouts/Default.jsx | 9 | |
| 14 | React.createElement( | server/web/layouts/Default.jsx | 9 | |
| 15 | 'head', | server/web/layouts/Default.jsx | 10 | |
| 16 | null, | server/web/layouts/Default.jsx | 10 | |
| 17 | React.createElement( | server/web/layouts/Default.jsx | 10 | |
| 18 | 'title', | server/web/layouts/Default.jsx | 11 | |
| 19 | null, | server/web/layouts/Default.jsx | 11 | |
| 20 | this.props.title | server/web/layouts/Default.jsx | 11 | |
| 21 | ), | server/web/layouts/Default.jsx | 11 | |
| 22 | React.createElement('meta', { charSet: 'utf-8' }), | server/web/layouts/Default.jsx | 11 | |
| 23 | React.createElement('meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0' }), | server/web/layouts/Default.jsx | 12 | |
| 24 | React.createElement('link', { rel: 'stylesheet', href: '/public/core.min.css' }), | server/web/layouts/Default.jsx | 13 | |
| 25 | React.createElement('link', { rel: 'stylesheet', href: '/public/layouts/default.min.css' }), | server/web/layouts/Default.jsx | 14 | |
| 26 | React.createElement('link', { rel: 'shortcut icon', href: '/public/media/favicon.ico' }), | server/web/layouts/Default.jsx | 15 | |
| 27 | this.props.neck | server/web/layouts/Default.jsx | 16 | |
| 28 | ), | server/web/layouts/Default.jsx | 17 | |
| 29 | React.createElement( | server/web/layouts/Default.jsx | 18 | |
| 30 | 'body', | server/web/layouts/Default.jsx | 19 | |
| 31 | null, | server/web/layouts/Default.jsx | 19 | |
| 32 | React.createElement(NavBar, { activeTab: this.props.activeTab }), | server/web/layouts/Default.jsx | 19 | |
| 33 | React.createElement( | server/web/layouts/Default.jsx | 20 | |
| 34 | 'div', | server/web/layouts/Default.jsx | 21 | |
| 35 | { className: 'page' }, | server/web/layouts/Default.jsx | 21 | |
| 36 | React.createElement( | server/web/layouts/Default.jsx | 21 | |
| 37 | 'div', | server/web/layouts/Default.jsx | 22 | |
| 38 | { className: 'container' }, | server/web/layouts/Default.jsx | 22 | |
| 39 | this.props.children | server/web/layouts/Default.jsx | 22 | |
| 40 | ) | server/web/layouts/Default.jsx | 23 | |
| 41 | ), | server/web/layouts/Default.jsx | 24 | |
| 42 | React.createElement( | server/web/layouts/Default.jsx | 25 | |
| 43 | 'div', | server/web/layouts/Default.jsx | 26 | |
| 44 | { className: 'footer' }, | server/web/layouts/Default.jsx | 26 | |
| 45 | React.createElement( | server/web/layouts/Default.jsx | 26 | |
| 46 | 'div', | server/web/layouts/Default.jsx | 27 | |
| 47 | { className: 'container' }, | server/web/layouts/Default.jsx | 27 | |
| 48 | React.createElement( | server/web/layouts/Default.jsx | 27 | |
| 49 | 'span', | server/web/layouts/Default.jsx | 28 | |
| 50 | { className: 'copyright pull-right' }, | server/web/layouts/Default.jsx | 28 | |
| 51 | '© 2014 Acme, Inc.' | server/web/layouts/Default.jsx | 28 | |
| 52 | ), | server/web/layouts/Default.jsx | 28 | |
| 53 | React.createElement( | server/web/layouts/Default.jsx | 30 | |
| 54 | 'ul', | server/web/layouts/Default.jsx | 31 | |
| 55 | { className: 'links' }, | server/web/layouts/Default.jsx | 31 | |
| 56 | React.createElement( | server/web/layouts/Default.jsx | 31 | |
| 57 | 'li', | server/web/layouts/Default.jsx | 32 | |
| 58 | null, | server/web/layouts/Default.jsx | 32 | |
| 59 | React.createElement( | server/web/layouts/Default.jsx | 32 | |
| 60 | 'a', | server/web/layouts/Default.jsx | 32 | |
| 61 | { href: '/' }, | server/web/layouts/Default.jsx | 32 | |
| 62 | 'Home' | server/web/layouts/Default.jsx | 32 | |
| 63 | ) | server/web/layouts/Default.jsx | 32 | |
| 64 | ), | server/web/layouts/Default.jsx | 32 | |
| 65 | React.createElement( | server/web/layouts/Default.jsx | 32 | |
| 66 | 'li', | server/web/layouts/Default.jsx | 33 | |
| 67 | null, | server/web/layouts/Default.jsx | 33 | |
| 68 | React.createElement( | server/web/layouts/Default.jsx | 33 | |
| 69 | 'a', | server/web/layouts/Default.jsx | 33 | |
| 70 | { href: '/contact' }, | server/web/layouts/Default.jsx | 33 | |
| 71 | 'Contact' | server/web/layouts/Default.jsx | 33 | |
| 72 | ) | server/web/layouts/Default.jsx | 33 | |
| 73 | ) | server/web/layouts/Default.jsx | 33 | |
| 74 | ), | server/web/layouts/Default.jsx | 33 | |
| 75 | React.createElement('div', { className: 'clearfix' }) | server/web/layouts/Default.jsx | 34 | |
| 76 | ) | server/web/layouts/Default.jsx | 35 | |
| 77 | ), | server/web/layouts/Default.jsx | 36 | |
| 78 | React.createElement('script', { src: '/public/core.min.js' }), | server/web/layouts/Default.jsx | 37 | |
| 79 | this.props.feet | server/web/layouts/Default.jsx | 38 | |
| 80 | ) | server/web/layouts/Default.jsx | 39 | |
| 81 | ); | server/web/layouts/Default.jsx | 40 | |
| 82 | } | server/web/layouts/Default.jsx | 42 | |
| 83 | }); | server/web/layouts/Default.jsx | 43 | |
| 84 | server/web/layouts/Default.jsx | 44 | ||
| 85 | 1 | module.exports = Component; | server/web/layouts/Default.jsx | 47 |
| 86 | server/web/layouts/Default.jsx | 47 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/layouts/NavBar.jsx | 1 | |
| 2 | server/web/layouts/NavBar.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/layouts/NavBar.jsx | 1 |
| 4 | 1 | var ClassNames = require('classnames'); | server/web/layouts/NavBar.jsx | 2 |
| 5 | server/web/layouts/NavBar.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/layouts/NavBar.jsx | 5 |
| 7 | displayName: 'Component', | server/web/layouts/NavBar.jsx | 5 | |
| 8 | server/web/layouts/NavBar.jsx | 5 | ||
| 9 | tabClass: function tabClass(tab) { | server/web/layouts/NavBar.jsx | 6 | |
| 10 | server/web/layouts/NavBar.jsx | 6 | ||
| 11 | 5 | return ClassNames({ | server/web/layouts/NavBar.jsx | 8 |
| 12 | active: this.props.activeTab === tab | server/web/layouts/NavBar.jsx | 9 | |
| 13 | }); | server/web/layouts/NavBar.jsx | 9 | |
| 14 | }, | server/web/layouts/NavBar.jsx | 10 | |
| 15 | render: function render() { | server/web/layouts/NavBar.jsx | 12 | |
| 16 | server/web/layouts/NavBar.jsx | 12 | ||
| 17 | 1 | return React.createElement( | server/web/layouts/NavBar.jsx | 14 |
| 18 | 'div', | server/web/layouts/NavBar.jsx | 15 | |
| 19 | { className: 'navbar navbar-default navbar-fixed-top' }, | server/web/layouts/NavBar.jsx | 15 | |
| 20 | React.createElement( | server/web/layouts/NavBar.jsx | 15 | |
| 21 | 'div', | server/web/layouts/NavBar.jsx | 16 | |
| 22 | { className: 'container' }, | server/web/layouts/NavBar.jsx | 16 | |
| 23 | React.createElement( | server/web/layouts/NavBar.jsx | 16 | |
| 24 | 'div', | server/web/layouts/NavBar.jsx | 17 | |
| 25 | { className: 'navbar-header' }, | server/web/layouts/NavBar.jsx | 17 | |
| 26 | React.createElement( | server/web/layouts/NavBar.jsx | 17 | |
| 27 | 'a', | server/web/layouts/NavBar.jsx | 18 | |
| 28 | { className: 'navbar-brand', href: '/' }, | server/web/layouts/NavBar.jsx | 18 | |
| 29 | React.createElement('img', { | server/web/layouts/NavBar.jsx | 18 | |
| 30 | className: 'navbar-logo', | server/web/layouts/NavBar.jsx | 20 | |
| 31 | src: '/public/media/logo-square.png' | server/web/layouts/NavBar.jsx | 21 | |
| 32 | }), | server/web/layouts/NavBar.jsx | 21 | |
| 33 | React.createElement( | server/web/layouts/NavBar.jsx | 22 | |
| 34 | 'span', | server/web/layouts/NavBar.jsx | 23 | |
| 35 | { className: 'navbar-brand-label' }, | server/web/layouts/NavBar.jsx | 23 | |
| 36 | 'Aqua' | server/web/layouts/NavBar.jsx | 23 | |
| 37 | ) | server/web/layouts/NavBar.jsx | 23 | |
| 38 | ) | server/web/layouts/NavBar.jsx | 23 | |
| 39 | ), | server/web/layouts/NavBar.jsx | 24 | |
| 40 | React.createElement( | server/web/layouts/NavBar.jsx | 25 | |
| 41 | 'div', | server/web/layouts/NavBar.jsx | 26 | |
| 42 | { className: 'navbar-collapse collapse' }, | server/web/layouts/NavBar.jsx | 26 | |
| 43 | React.createElement( | server/web/layouts/NavBar.jsx | 26 | |
| 44 | 'ul', | server/web/layouts/NavBar.jsx | 27 | |
| 45 | { className: 'nav navbar-nav' }, | server/web/layouts/NavBar.jsx | 27 | |
| 46 | React.createElement( | server/web/layouts/NavBar.jsx | 27 | |
| 47 | 'li', | server/web/layouts/NavBar.jsx | 28 | |
| 48 | { className: this.tabClass('home') }, | server/web/layouts/NavBar.jsx | 28 | |
| 49 | React.createElement( | server/web/layouts/NavBar.jsx | 28 | |
| 50 | 'a', | server/web/layouts/NavBar.jsx | 29 | |
| 51 | { href: '/' }, | server/web/layouts/NavBar.jsx | 29 | |
| 52 | 'Home' | server/web/layouts/NavBar.jsx | 29 | |
| 53 | ) | server/web/layouts/NavBar.jsx | 29 | |
| 54 | ), | server/web/layouts/NavBar.jsx | 29 | |
| 55 | React.createElement( | server/web/layouts/NavBar.jsx | 30 | |
| 56 | 'li', | server/web/layouts/NavBar.jsx | 31 | |
| 57 | { className: this.tabClass('about') }, | server/web/layouts/NavBar.jsx | 31 | |
| 58 | React.createElement( | server/web/layouts/NavBar.jsx | 31 | |
| 59 | 'a', | server/web/layouts/NavBar.jsx | 32 | |
| 60 | { href: '/about' }, | server/web/layouts/NavBar.jsx | 32 | |
| 61 | 'About' | server/web/layouts/NavBar.jsx | 32 | |
| 62 | ) | server/web/layouts/NavBar.jsx | 32 | |
| 63 | ), | server/web/layouts/NavBar.jsx | 32 | |
| 64 | React.createElement( | server/web/layouts/NavBar.jsx | 33 | |
| 65 | 'li', | server/web/layouts/NavBar.jsx | 34 | |
| 66 | { className: this.tabClass('signup') }, | server/web/layouts/NavBar.jsx | 34 | |
| 67 | React.createElement( | server/web/layouts/NavBar.jsx | 34 | |
| 68 | 'a', | server/web/layouts/NavBar.jsx | 35 | |
| 69 | { href: '/signup' }, | server/web/layouts/NavBar.jsx | 35 | |
| 70 | 'Sign up' | server/web/layouts/NavBar.jsx | 35 | |
| 71 | ) | server/web/layouts/NavBar.jsx | 35 | |
| 72 | ), | server/web/layouts/NavBar.jsx | 35 | |
| 73 | React.createElement( | server/web/layouts/NavBar.jsx | 36 | |
| 74 | 'li', | server/web/layouts/NavBar.jsx | 37 | |
| 75 | { className: this.tabClass('contact') }, | server/web/layouts/NavBar.jsx | 37 | |
| 76 | React.createElement( | server/web/layouts/NavBar.jsx | 37 | |
| 77 | 'a', | server/web/layouts/NavBar.jsx | 38 | |
| 78 | { href: '/contact' }, | server/web/layouts/NavBar.jsx | 38 | |
| 79 | 'Contact' | server/web/layouts/NavBar.jsx | 38 | |
| 80 | ) | server/web/layouts/NavBar.jsx | 38 | |
| 81 | ) | server/web/layouts/NavBar.jsx | 38 | |
| 82 | ), | server/web/layouts/NavBar.jsx | 39 | |
| 83 | React.createElement( | server/web/layouts/NavBar.jsx | 40 | |
| 84 | 'ul', | server/web/layouts/NavBar.jsx | 41 | |
| 85 | { className: 'nav navbar-nav navbar-right' }, | server/web/layouts/NavBar.jsx | 41 | |
| 86 | React.createElement( | server/web/layouts/NavBar.jsx | 41 | |
| 87 | 'li', | server/web/layouts/NavBar.jsx | 42 | |
| 88 | { className: this.tabClass('login') }, | server/web/layouts/NavBar.jsx | 42 | |
| 89 | React.createElement( | server/web/layouts/NavBar.jsx | 42 | |
| 90 | 'a', | server/web/layouts/NavBar.jsx | 43 | |
| 91 | { href: '/login' }, | server/web/layouts/NavBar.jsx | 43 | |
| 92 | 'Sign in' | server/web/layouts/NavBar.jsx | 43 | |
| 93 | ) | server/web/layouts/NavBar.jsx | 43 | |
| 94 | ) | server/web/layouts/NavBar.jsx | 43 | |
| 95 | ) | server/web/layouts/NavBar.jsx | 44 | |
| 96 | ) | server/web/layouts/NavBar.jsx | 45 | |
| 97 | ) | server/web/layouts/NavBar.jsx | 46 | |
| 98 | ); | server/web/layouts/NavBar.jsx | 47 | |
| 99 | } | server/web/layouts/NavBar.jsx | 49 | |
| 100 | }); | server/web/layouts/NavBar.jsx | 50 | |
| 101 | server/web/layouts/NavBar.jsx | 51 | ||
| 102 | 1 | module.exports = Component; | server/web/layouts/NavBar.jsx | 54 |
| 103 | server/web/layouts/NavBar.jsx | 54 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | "use strict"; | server/web/layouts/Plain.jsx | 1 | |
| 2 | server/web/layouts/Plain.jsx | 2 | ||
| 3 | 1 | var React = require("react/addons"); | server/web/layouts/Plain.jsx | 1 |
| 4 | server/web/layouts/Plain.jsx | 1 | ||
| 5 | 1 | var Component = React.createClass({ | server/web/layouts/Plain.jsx | 4 |
| 6 | displayName: "Component", | server/web/layouts/Plain.jsx | 4 | |
| 7 | server/web/layouts/Plain.jsx | 4 | ||
| 8 | render: function render() { | server/web/layouts/Plain.jsx | 5 | |
| 9 | server/web/layouts/Plain.jsx | 5 | ||
| 10 | 1 | return React.createElement( | server/web/layouts/Plain.jsx | 7 |
| 11 | "html", | server/web/layouts/Plain.jsx | 8 | |
| 12 | null, | server/web/layouts/Plain.jsx | 8 | |
| 13 | React.createElement( | server/web/layouts/Plain.jsx | 8 | |
| 14 | "head", | server/web/layouts/Plain.jsx | 9 | |
| 15 | null, | server/web/layouts/Plain.jsx | 9 | |
| 16 | React.createElement( | server/web/layouts/Plain.jsx | 9 | |
| 17 | "title", | server/web/layouts/Plain.jsx | 10 | |
| 18 | null, | server/web/layouts/Plain.jsx | 10 | |
| 19 | this.props.title | server/web/layouts/Plain.jsx | 10 | |
| 20 | ), | server/web/layouts/Plain.jsx | 10 | |
| 21 | React.createElement("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }), | server/web/layouts/Plain.jsx | 10 | |
| 22 | React.createElement("link", { rel: "stylesheet", href: "/public/core.min.css" }), | server/web/layouts/Plain.jsx | 11 | |
| 23 | React.createElement("link", { rel: "shortcut icon", href: "/public/media/favicon.ico" }), | server/web/layouts/Plain.jsx | 12 | |
| 24 | this.props.neck | server/web/layouts/Plain.jsx | 13 | |
| 25 | ), | server/web/layouts/Plain.jsx | 14 | |
| 26 | React.createElement( | server/web/layouts/Plain.jsx | 15 | |
| 27 | "body", | server/web/layouts/Plain.jsx | 16 | |
| 28 | null, | server/web/layouts/Plain.jsx | 16 | |
| 29 | this.props.children, | server/web/layouts/Plain.jsx | 16 | |
| 30 | React.createElement("script", { src: "/public/core.min.js" }), | server/web/layouts/Plain.jsx | 17 | |
| 31 | this.props.feet | server/web/layouts/Plain.jsx | 18 | |
| 32 | ) | server/web/layouts/Plain.jsx | 19 | |
| 33 | ); | server/web/layouts/Plain.jsx | 20 | |
| 34 | } | server/web/layouts/Plain.jsx | 22 | |
| 35 | }); | server/web/layouts/Plain.jsx | 23 | |
| 36 | server/web/layouts/Plain.jsx | 24 | ||
| 37 | 1 | module.exports = Component; | server/web/layouts/Plain.jsx | 27 |
| 38 | server/web/layouts/Plain.jsx | 27 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 2 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/login/{glob*}', | |
| 6 | config: { | |
| 7 | auth: { | |
| 8 | mode: 'try', | |
| 9 | strategy: 'session' | |
| 10 | }, | |
| 11 | plugins: { | |
| 12 | 'hapi-auth-cookie': { | |
| 13 | redirectTo: false | |
| 14 | } | |
| 15 | } | |
| 16 | }, | |
| 17 | handler: function (request, reply) { | |
| 18 | ||
| 19 | 4 | if (request.params.glob !== 'logout' && |
| 20 | request.auth.isAuthenticated) { | |
| 21 | ||
| 22 | 2 | if (request.auth.credentials.user.roles.admin) { |
| 23 | 1 | return reply.redirect('/admin'); |
| 24 | } | |
| 25 | ||
| 26 | 1 | return reply.redirect('/account'); |
| 27 | } | |
| 28 | ||
| 29 | 2 | var response = reply.view('login/index'); |
| 30 | 2 | response.header('x-auth-required', true); |
| 31 | } | |
| 32 | }); | |
| 33 | ||
| 34 | ||
| 35 | 2 | next(); |
| 36 | }; | |
| 37 | ||
| 38 | ||
| 39 | 1 | exports.register.attributes = { |
| 40 | name: 'web/login' | |
| 41 | }; | |
| 42 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/login/index.jsx | 1 | |
| 2 | server/web/login/index.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/login/index.jsx | 1 |
| 4 | 1 | var Layout = require('../layouts/Default.jsx'); | server/web/login/index.jsx | 2 |
| 5 | server/web/login/index.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/login/index.jsx | 5 |
| 7 | displayName: 'Component', | server/web/login/index.jsx | 5 | |
| 8 | server/web/login/index.jsx | 5 | ||
| 9 | render: function render() { | server/web/login/index.jsx | 6 | |
| 10 | server/web/login/index.jsx | 6 | ||
| 11 | 1 | var feet = React.createElement('script', { src: '/public/pages/login.min.js' }); | server/web/login/index.jsx | 8 |
| 12 | server/web/login/index.jsx | 8 | ||
| 13 | 1 | return React.createElement( | server/web/login/index.jsx | 10 |
| 14 | Layout, | server/web/login/index.jsx | 11 | |
| 15 | { | server/web/login/index.jsx | 11 | |
| 16 | title: 'Sign in', | server/web/login/index.jsx | 12 | |
| 17 | feet: feet, | server/web/login/index.jsx | 13 | |
| 18 | activeTab: 'login' }, | server/web/login/index.jsx | 14 | |
| 19 | React.createElement( | server/web/login/index.jsx | 14 | |
| 20 | 'div', | server/web/login/index.jsx | 16 | |
| 21 | { className: 'row' }, | server/web/login/index.jsx | 16 | |
| 22 | React.createElement('div', { className: 'col-sm-6', id: 'app-mount' }) | server/web/login/index.jsx | 16 | |
| 23 | ) | server/web/login/index.jsx | 17 | |
| 24 | ); | server/web/login/index.jsx | 18 | |
| 25 | } | server/web/login/index.jsx | 20 | |
| 26 | }); | server/web/login/index.jsx | 21 | |
| 27 | server/web/login/index.jsx | 22 | ||
| 28 | 1 | module.exports = Component; | server/web/login/index.jsx | 25 |
| 29 | server/web/login/index.jsx | 25 |
| Line | Hits | Source |
|---|---|---|
| 1 | 1 | exports.register = function (plugin, options, next) { |
| 2 | ||
| 3 | 2 | plugin.route({ |
| 4 | method: 'GET', | |
| 5 | path: '/signup', | |
| 6 | handler: function (request, reply) { | |
| 7 | ||
| 8 | 1 | reply.view('signup/index'); |
| 9 | } | |
| 10 | }); | |
| 11 | ||
| 12 | ||
| 13 | 2 | next(); |
| 14 | }; | |
| 15 | ||
| 16 | ||
| 17 | 1 | exports.register.attributes = { |
| 18 | name: 'web/signup' | |
| 19 | }; | |
| 20 |
| Line | Hits | Source | Original filename | Original line |
|---|---|---|---|---|
| 1 | 'use strict'; | server/web/signup/index.jsx | 1 | |
| 2 | server/web/signup/index.jsx | 2 | ||
| 3 | 1 | var React = require('react/addons'); | server/web/signup/index.jsx | 1 |
| 4 | 1 | var Layout = require('../layouts/Default.jsx'); | server/web/signup/index.jsx | 2 |
| 5 | server/web/signup/index.jsx | 2 | ||
| 6 | 1 | var Component = React.createClass({ | server/web/signup/index.jsx | 5 |
| 7 | displayName: 'Component', | server/web/signup/index.jsx | 5 | |
| 8 | server/web/signup/index.jsx | 5 | ||
| 9 | render: function render() { | server/web/signup/index.jsx | 6 | |
| 10 | server/web/signup/index.jsx | 6 | ||
| 11 | 1 | var feet = React.createElement('script', { src: '/public/pages/signup.min.js' }); | server/web/signup/index.jsx | 8 |
| 12 | server/web/signup/index.jsx | 8 | ||
| 13 | 1 | return React.createElement( | server/web/signup/index.jsx | 10 |
| 14 | Layout, | server/web/signup/index.jsx | 11 | |
| 15 | { | server/web/signup/index.jsx | 11 | |
| 16 | title: 'Sign up', | server/web/signup/index.jsx | 12 | |
| 17 | feet: feet, | server/web/signup/index.jsx | 13 | |
| 18 | activeTab: 'signup' }, | server/web/signup/index.jsx | 14 | |
| 19 | React.createElement( | server/web/signup/index.jsx | 14 | |
| 20 | 'div', | server/web/signup/index.jsx | 16 | |
| 21 | { className: 'row' }, | server/web/signup/index.jsx | 16 | |
| 22 | React.createElement('div', { className: 'col-sm-6', id: 'app-mount' }), | server/web/signup/index.jsx | 16 | |
| 23 | React.createElement( | server/web/signup/index.jsx | 17 | |
| 24 | 'div', | server/web/signup/index.jsx | 18 | |
| 25 | { className: 'col-sm-6 text-center' }, | server/web/signup/index.jsx | 18 | |
| 26 | React.createElement( | server/web/signup/index.jsx | 18 | |
| 27 | 'h1', | server/web/signup/index.jsx | 19 | |
| 28 | { className: 'page-header' }, | server/web/signup/index.jsx | 19 | |
| 29 | 'Campy benefits' | server/web/signup/index.jsx | 19 | |
| 30 | ), | server/web/signup/index.jsx | 19 | |
| 31 | React.createElement( | server/web/signup/index.jsx | 19 | |
| 32 | 'p', | server/web/signup/index.jsx | 20 | |
| 33 | { className: 'lead' }, | server/web/signup/index.jsx | 20 | |
| 34 | 'Really, you will love it inside. It\'s super great!' | server/web/signup/index.jsx | 20 | |
| 35 | ), | server/web/signup/index.jsx | 20 | |
| 36 | React.createElement('i', { className: 'fa fa-thumbs-o-up bamf' }) | server/web/signup/index.jsx | 22 | |
| 37 | ) | server/web/signup/index.jsx | 23 | |
| 38 | ) | server/web/signup/index.jsx | 24 | |
| 39 | ); | server/web/signup/index.jsx | 25 | |
| 40 | } | server/web/signup/index.jsx | 27 | |
| 41 | }); | server/web/signup/index.jsx | 28 | |
| 42 | server/web/signup/index.jsx | 29 | ||
| 43 | 1 | module.exports = Component; | server/web/signup/index.jsx | 32 |
| 44 | server/web/signup/index.jsx | 32 |